From 612bab6ec5059c97440593826eb4873c0ed9c04a Mon Sep 17 00:00:00 2001 From: vaishnavi-vinodh <63830657+vaishnavi-vinodh@users.noreply.github.com> Date: Fri, 7 May 2021 23:19:33 -0400 Subject: [PATCH] Update utility.py PR: Updating Utility.py - Deleting deprecated methods in Utility.py as they are no longer in use as of Dec 21 2019 --- aguaclara/core/utility.py | 39 --------------------------------------- 1 file changed, 39 deletions(-) diff --git a/aguaclara/core/utility.py b/aguaclara/core/utility.py index dad5a589..39fef69a 100644 --- a/aguaclara/core/utility.py +++ b/aguaclara/core/utility.py @@ -75,24 +75,6 @@ def round_sig_figs(num, figs=4): return num -def round_sf(num, figs=4): - """Round a number to some amount of significant figures. - - Args: - - ``num (float)``: Value to be rounded (optional units) - - ``figs (int)``: Number of significant digits to be rounded to - (recommended, defaults to 4) - - Note: This function will be deprecated after 21 Dec 2019. Use - round_sig_figs instead. - """ - warnings.warn( - 'round_sf will be deprecated after 21 Dec 2019. Use ' - 'round_sig_figs instead.', - FutureWarning - ) - round_sig_figs(num, figs = figs) - @optional_units([0, 1], ['num', 'step']) def _stepper(num, step=10, func=round): """Round a number to be a multiple of some step. @@ -135,27 +117,6 @@ def floor_step(num, step=10): """Like :func:`round_step`, but ``num`` is always rounded down.""" return _stepper(num, step = step, func = floor) -def stepceil_with_units(param, step, unit): - """Round a number up to be a multiple of some step. - - Args: - - ``param (float)``: Value to be rounded (optional units) - - ``step (float)``: Factor to which ``param`` will be rounded - - ``unit (Quantity)``: units of ``step`` - - Note: this function will be deprecated after 21 Dec 2019. Use ceil_step - instead. - """ - warnings.warn( - 'stepceil_with_units will be deprecated after 21 Dec 2019. Use ' - 'ceil_step instead.', - FutureWarning - ) - counter = 0 * unit - while counter < param.to(unit): - counter += step * unit - return counter - def floor_nearest(x, array): """Get the nearest element of a NumPy array less than or equal to a value.