From 1a1e7a04e89c5e5a47ee7cf7280a284975342ce1 Mon Sep 17 00:00:00 2001 From: Bart Schilperoort Date: Fri, 13 Sep 2024 15:29:02 +0200 Subject: [PATCH] Simplify dependencies, release prep for 3.1 (#221) * Update authors, changelog * Add Python 3.12 to the pyproj classifiers * Bump the version to 3.1.0 * Simplify dependencies. Make statsmodels optional. * Add note, run statsmodels tests if available. * Remove unneeded "pass" statements, unnecessary whitespace * Add Python 3.12 to the hatch test matrix * Update changelog --- .bumpversion.cfg | 2 +- AUTHORS.rst | 1 + CHANGELOG.rst | 17 ++++++--- CITATION.cff | 2 +- CONTRIBUTING.rst | 1 - README.rst | 4 +- docs/conf.py | 3 +- pyproject.toml | 15 ++++---- src/dtscalibration/calibrate_utils.py | 14 ++++++- .../calibration/section_utils.py | 4 -- src/dtscalibration/dts_accessor.py | 5 --- src/dtscalibration/dts_accessor_utils.py | 4 -- src/dtscalibration/io/apsensing.py | 4 +- src/dtscalibration/variance_helpers.py | 9 ++++- src/dtscalibration/variance_stokes.py | 3 -- tests/test_averaging.py | 2 - tests/test_dtscalibration.py | 37 +++++-------------- tests/test_variance_stokes.py | 17 --------- 18 files changed, 55 insertions(+), 89 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 64125e05..219cd8df 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 3.0.3 +current_version = 3.1.0 commit = True tag = True diff --git a/AUTHORS.rst b/AUTHORS.rst index 85a0b612..bfc82e53 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -5,3 +5,4 @@ Authors * Bas des Tombe - https://github.com/bdestombe * Bart Schilperoort - https://github.com/BSchilperoort * Karl Lapo - https://github.com/klapo +* David Rautenberg - https://github.com/davechris diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 2d79f79e..44945e25 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,18 +1,25 @@ Changelog ========= -3.0.4 (2024-08-30) +3.1.0 (2024-09-13) --- +Added + +* support for Python 3.12. +* AP sensing .tra support, as the reference temperature sensor data by this device in only logged in .tra and not in the .xml log files. + added functions in io/apsensing.py to read .tra files if they are in the same directory as the .xml files. +* more test data from AP sensing device N4386B, which do also contain their .tra log files + Fixed * device ID bug for APSensing. Device ID is N4386B instead of C320. C320 was an arbitrary name given for the wellbore by the user. -Added +Changed + +* the `verify_timedeltas` keyword argument is now optional when merging two single ended datasets. +* removed `statsmodels` as a dependency. It is now optional, and only used for testing the `wls_sparse` solver -* more test data from AP sensing device N4386B, which do also contain their .tra log files -* AP sensing .tra support, as the reference temperature sensor data by this device in only logged in .tra and not in the .xml log files. - added functions in io/apsensing.py to read .tra files if they are in the same directory as the .xml files. 3.0.3 (2024-04-18) --- diff --git a/CITATION.cff b/CITATION.cff index 35168610..81880d17 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -22,5 +22,5 @@ doi: "10.5281/zenodo.1410097" license: "BSD-3-Clause" repository-code: "https://github.com/dtscalibration/python-dts-calibration" title: "Python distributed temperature sensing calibration" -version: "v3.0.3" +version: "v3.1.0" url: "https://python-dts-calibration.readthedocs.io" diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index f3951589..2cfa7751 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -53,7 +53,6 @@ To set up `python-dts-calibration` for local development: pip install -e ".[dev]" - 4. When you're done making changes, make sure the code follows the right style, that all tests pass, and that the docs build with the following commands:: hatch run format diff --git a/README.rst b/README.rst index f0fec1e3..d9344d28 100644 --- a/README.rst +++ b/README.rst @@ -29,9 +29,9 @@ Overview :alt: PyPI Package latest release :target: https://pypi.python.org/pypi/dtscalibration -.. |commits-since| image:: https://img.shields.io/github/commits-since/dtscalibration/python-dts-calibration/v3.0.3.svg +.. |commits-since| image:: https://img.shields.io/github/commits-since/dtscalibration/python-dts-calibration/v3.1.0.svg :alt: Commits since latest release - :target: https://github.com/dtscalibration/python-dts-calibration/compare/v1.1.1...main + :target: https://github.com/dtscalibration/python-dts-calibration/compare/v3.1.0...main .. |wheel| image:: https://img.shields.io/pypi/wheel/dtscalibration.svg :alt: PyPI Wheel diff --git a/docs/conf.py b/docs/conf.py index a2c68257..dff30dc0 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -40,14 +40,13 @@ spelling_show_suggestions = True spelling_lang = "en_US" - source_suffix = [".rst", ".md"] master_doc = "index" project = "dtscalibration" year = str(date.today().year) author = "Bas des Tombe and Bart Schilperoort" copyright = f"{year}, {author}" -version = release = "3.0.3" +version = release = "3.1.0" pygments_style = "trac" templates_path = [".", sphinx_autosummary_accessors.templates_path] diff --git a/pyproject.toml b/pyproject.toml index 59433435..6dd00257 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,7 @@ disable = true # Requires confirmation when publishing to pypi. [project] name = "dtscalibration" -version = "3.0.3" +version = "3.1.0" description = "Load Distributed Temperature Sensing (DTS) files, calibrate the temperature and estimate its uncertainty." readme = "README.rst" license = "BSD-3-Clause" @@ -48,19 +48,17 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Utilities", ] dependencies = [ - "numpy>=1.22.4, <=2.0.1", # >= 1.22 for quantile method support in xarray. https://github.com/statsmodels/statsmodels/issues/9333 - "dask", + "numpy", + "xarray[accel]", + "dask[distributed]", "pandas", - "xarray[parallel]", # numbagg (llvmlite) is a pain to install with pip - "bottleneck", # speeds up Xarray - "flox", # speeds up Xarray "pyyaml>=6.0.1", "xmltodict", "scipy", - "statsmodels", "matplotlib", "netCDF4>=1.6.4", "nc-time-axis>=1.4.1" # plot dependency of xarray @@ -128,10 +126,11 @@ build = [ features = ["dev"] [[tool.hatch.envs.matrix_test.matrix]] -python = ["3.9", "3.10", "3.11"] +python = ["3.9", "3.10", "3.11", "3.12"] [tool.hatch.envs.matrix_test.scripts] test = ["pytest ./src/ ./tests/",] # --doctest-modules +fast-test = ["pytest ./tests/ -m \"not slow\"",] [tool.pytest.ini_options] testpaths = ["tests"] diff --git a/src/dtscalibration/calibrate_utils.py b/src/dtscalibration/calibrate_utils.py index dba3b8a3..6d60c1e5 100644 --- a/src/dtscalibration/calibrate_utils.py +++ b/src/dtscalibration/calibrate_utils.py @@ -1,6 +1,5 @@ import numpy as np import scipy.sparse as sp -import statsmodels.api as sm import xarray as xr from scipy.sparse import linalg as ln @@ -1673,7 +1672,6 @@ def construct_submatrices_matching_sections(x, ix_sec, hix, tix, nt, trans_att): Zero_d_eq12 : sparse matrix Zero in EQ1 and EQ2 - """ # contains all indices of the entire fiber that either are using for # calibrating to reference temperature or for matching sections. Is sorted. @@ -1988,6 +1986,9 @@ def wls_sparse( ): """Weighted least squares solver. + Note: during development this solver was compared to the statsmodels solver. To + enable the comparison tests again, install `statsmodels` before running pytest. + If some initial estimate x0 is known and if damp == 0, one could proceed as follows: - Compute a residual vector r0 = b - A*x0. - Use LSQR to solve the system A*dx = r0. @@ -2124,6 +2125,15 @@ def wls_stats(X, y, w=1.0, calc_cov=False, x0=None, return_werr=False, verbose=F p_cov : ndarray The covariance of the solution. """ + try: + import statsmodels.api as sm + except ModuleNotFoundError as err: + msg = ( + "Statsmodels has to be installed for this function.\n" + "Install it with `pip install statsmodels`." + ) + raise ModuleNotFoundError(msg) from err + y = np.asarray(y) w = np.asarray(w) diff --git a/src/dtscalibration/calibration/section_utils.py b/src/dtscalibration/calibration/section_utils.py index bbb8edde..700ac5b5 100644 --- a/src/dtscalibration/calibration/section_utils.py +++ b/src/dtscalibration/calibration/section_utils.py @@ -43,7 +43,6 @@ def validate_no_overlapping_sections(sections: dict[str, list[slice]]): assert all_start_stop_startsort_flat == sorted( all_start_stop_startsort_flat ), "Sections contains overlapping stretches" - pass def validate_sections_definition(sections: dict[str, list[slice]]): @@ -123,7 +122,6 @@ def validate_sections(ds: xr.Dataset, sections: dict[str, list[slice]]): f"Better define the {k} section. You tried {vi}, " "which is not within the x-dimension" ) - pass def ufunc_per_section( @@ -176,7 +174,6 @@ def ufunc_per_section( TODO: Spend time on creating a slice instead of appendng everything\ to a list and concatenating after. - Returns: -------- @@ -241,7 +238,6 @@ def ufunc_per_section( >>> ix_loc = d.ufunc_per_section(sections, x_indices=True) - Note: ---- If `self[label]` or `self[subtract_from_label]` is a Dask array, a Dask diff --git a/src/dtscalibration/dts_accessor.py b/src/dtscalibration/dts_accessor.py index d97c8a4c..a56c4058 100644 --- a/src/dtscalibration/dts_accessor.py +++ b/src/dtscalibration/dts_accessor.py @@ -335,7 +335,6 @@ def ufunc_per_section( TODO: Spend time on creating a slice instead of appendng everything\ to a list and concatenating after. - Returns: -------- dict @@ -408,7 +407,6 @@ def ufunc_per_section( >>> ix_loc = d.ufunc_per_section(sections=sections, x_indices=True) - Notes: ------ If `self[label]` or `self[subtract_from_label]` is a Dask array, a Dask @@ -494,7 +492,6 @@ def calibrate_single_ended( I(x,t) = \ln{\left(\frac{P_+(x,t)}{P_-(x,t)}\right)} - .. math:: C(t) = \ln{\left(\frac{\eta_-(t)K_-/\lambda_-^4}{\eta_+(t)K_+/\lambda_+^4}\right)} @@ -879,7 +876,6 @@ def calibrate_double_ended( :math:`T_\mathrm{F}` and :math:`T_\mathrm{B}` as discussed in Section 7.2 [1]_ . - Parameters ---------- p_val : array-like, optional @@ -1991,7 +1987,6 @@ def average_monte_carlo_single_ended( Four types of averaging are implemented. Please see Example Notebook 16. - Parameters ---------- result : xr.Dataset diff --git a/src/dtscalibration/dts_accessor_utils.py b/src/dtscalibration/dts_accessor_utils.py index e986d15e..3f6d9c2d 100644 --- a/src/dtscalibration/dts_accessor_utils.py +++ b/src/dtscalibration/dts_accessor_utils.py @@ -393,7 +393,6 @@ def get_netcdf_encoding( TODO: Truncate precision to XML precision per data variable - Parameters ---------- zlib @@ -905,7 +904,6 @@ def shift_double_ended( There is no interpolation, as this would alter the accuracy. - Parameters ---------- ds : DataSore object @@ -999,7 +997,6 @@ def suggest_cable_shift_double_ended( anti-Stokes The bottom plot is generated that shows the two objective functions - Parameters ---------- ds : Xarray Dataset @@ -1229,7 +1226,6 @@ def ufunc_per_section_helper( >>> ix_loc = ufunc_per_section_helper(x_coords=d.x) - Note: ---- If `dataarray` or `subtract_from_dataarray` is a Dask array, a Dask diff --git a/src/dtscalibration/io/apsensing.py b/src/dtscalibration/io/apsensing.py index 2a966551..14481b2a 100644 --- a/src/dtscalibration/io/apsensing.py +++ b/src/dtscalibration/io/apsensing.py @@ -56,7 +56,7 @@ def read_apsensing_files( load_in_memory : {'auto', True, False} If 'auto' the Stokes data is only loaded to memory for small files load_tra_arrays : bool - If true and tra files available, the tra array data will imported. + If true and tra files available, the tra array data will imported. Current implementation is limited to in-memory reading only. kwargs : dict-like, optional keyword-arguments are passed to DataStore initialization @@ -526,7 +526,6 @@ def read_single_tra_file(tra_filepath, load_tra_arrays): - log_ratio and loss(attenuation) calculated by device - PT100 sensor data (optional only if sensors are connnected to device) - Parameters ---------- tra_filepathlist: list of str @@ -585,7 +584,6 @@ def append_to_data_vars_structure(data_vars, data_dict_list, load_tra_arrays): append data from .tra files to data_vars structure. (The data_vars structure is later on used to initialize the x-array dataset). - Parameters ---------- data_vars: dictionary containing *.xml data diff --git a/src/dtscalibration/variance_helpers.py b/src/dtscalibration/variance_helpers.py index ee66ff57..618885bf 100644 --- a/src/dtscalibration/variance_helpers.py +++ b/src/dtscalibration/variance_helpers.py @@ -76,7 +76,14 @@ def variance_stokes_exponential_helper( if use_statsmodels: # returns the same answer with statsmodel - import statsmodels.api as sm + try: + import statsmodels.api as sm + except ModuleNotFoundError as err: + msg = ( + "Statsmodels has to be installed for this function.\n" + "Install it with `pip install statsmodels`." + ) + raise ModuleNotFoundError(msg) from err X = sp.coo_matrix( (data, coords), shape=(nt * n_locs, ddof), dtype=float, copy=False diff --git a/src/dtscalibration/variance_stokes.py b/src/dtscalibration/variance_stokes.py index 28b45a94..22fefd59 100644 --- a/src/dtscalibration/variance_stokes.py +++ b/src/dtscalibration/variance_stokes.py @@ -29,7 +29,6 @@ def variance_stokes_constant(st, sections, acquisitiontime, reshape_residuals=Tr st_var = a * ds.st + b - where `a` and `b` are constants. Requires reference sections at beginning and end of the fiber, to have residuals at high and low intensity measurements. @@ -168,7 +167,6 @@ def variance_stokes_exponential( st_var = a * ds.st + b - where `a` and `b` are constants. Requires reference sections at beginning and end of the fiber, to have residuals at high and low intensity measurements. @@ -361,7 +359,6 @@ def variance_stokes_linear( st_var = a * ds.st + b - where `a` and `b` are constants. Requires reference sections at beginning and end of the fiber, to have residuals at high and low intensity measurements. diff --git a/tests/test_averaging.py b/tests/test_averaging.py index c85464e4..ef77a364 100644 --- a/tests/test_averaging.py +++ b/tests/test_averaging.py @@ -46,7 +46,6 @@ def assert_almost_equal_verbose(actual, desired, verbose=False, **kwargs): desired2 = np.broadcast_to(desired, actual.shape) np.testing.assert_almost_equal(actual, desired2, err_msg=m, **kwargs) - pass def test_average_measurements_single_ended(): @@ -111,7 +110,6 @@ def get_section_indices(x_da, sec): ci_avg_time_flag2=True, ci_avg_time_isel=range(3), ) - pass def test_average_measurements_double_ended(): diff --git a/tests/test_dtscalibration.py b/tests/test_dtscalibration.py index 477a71c5..ffbc2a14 100644 --- a/tests/test_dtscalibration.py +++ b/tests/test_dtscalibration.py @@ -57,7 +57,6 @@ def assert_almost_equal_verbose(actual, desired, verbose=False, **kwargs): desired2 = np.broadcast_to(desired, actual.shape) np.testing.assert_almost_equal(actual, desired2, err_msg=m, **kwargs) - pass def test_double_ended_wls_estimate_synthetic(): @@ -268,7 +267,6 @@ def test_double_ended_wls_estimate_synthetic_df_and_db_are_different(): assert_almost_equal_verbose(temp_real_celsius, out["tmpf"].values, decimal=10) assert_almost_equal_verbose(temp_real_celsius, out["tmpb"].values, decimal=10) assert_almost_equal_verbose(temp_real_celsius, out["tmpw"].values, decimal=10) - pass @pytest.mark.xfail @@ -367,7 +365,6 @@ def test_fail_if_st_labels_are_passed_to_calibration_function(): fix_gamma=(gamma, 0.0), mc_remove_set_flag=True, ) - pass def test_double_ended_asymmetrical_attenuation(): @@ -472,7 +469,6 @@ def test_double_ended_asymmetrical_attenuation(): assert_almost_equal_verbose(temp_real_celsius, out.tmpf.values, decimal=7) assert_almost_equal_verbose(temp_real_celsius, out.tmpb.values, decimal=7) assert_almost_equal_verbose(temp_real_celsius, out.tmpw.values, decimal=7) - pass def test_double_ended_one_matching_section_and_one_asym_att(): @@ -706,7 +702,6 @@ def test_double_ended_two_matching_sections_and_two_asym_atts(): assert_almost_equal_verbose(temp_real_celsius, out["tmpf"].values, decimal=7) assert_almost_equal_verbose(temp_real_celsius, out["tmpb"].values, decimal=7) assert_almost_equal_verbose(temp_real_celsius, out["tmpw"].values, decimal=7) - pass def test_double_ended_wls_fix_gamma_estimate_synthetic(): @@ -804,8 +799,6 @@ def test_double_ended_wls_fix_gamma_estimate_synthetic(): assert_almost_equal_verbose(out["tmpb"].values, temp_real - 273.15, decimal=6) assert_almost_equal_verbose(out["tmpw"].values, temp_real - 273.15, decimal=6) - pass - def test_double_ended_wls_fix_alpha_estimate_synthetic(): """Checks whether the coefficients are correctly defined by creating a @@ -897,8 +890,6 @@ def test_double_ended_wls_fix_alpha_estimate_synthetic(): assert_almost_equal_verbose(out["tmpb"].values, temp_real - 273.15, decimal=7) assert_almost_equal_verbose(out["tmpw"].values, temp_real - 273.15, decimal=7) - pass - def test_double_ended_wls_fix_alpha_fix_gamma_estimate_synthetic(): """Checks whether the coefficients are correctly defined by creating a @@ -991,8 +982,6 @@ def test_double_ended_wls_fix_alpha_fix_gamma_estimate_synthetic(): assert_almost_equal_verbose(out["tmpb"].values, temp_real - 273.15, decimal=11) assert_almost_equal_verbose(out["tmpw"].values, temp_real - 273.15, decimal=11) - pass - def test_double_ended_fix_alpha_matching_sections_and_one_asym_att(): cable_len = 100.0 @@ -1129,7 +1118,6 @@ def test_double_ended_fix_alpha_matching_sections_and_one_asym_att(): assert_almost_equal_verbose(temp_real_celsius, out["tmpf"].values, decimal=7) assert_almost_equal_verbose(temp_real_celsius, out["tmpb"].values, decimal=7) assert_almost_equal_verbose(temp_real_celsius, out["tmpw"].values, decimal=7) - pass def test_double_ended_fix_alpha_gamma_matching_sections_and_one_asym_att(): @@ -1268,7 +1256,6 @@ def test_double_ended_fix_alpha_gamma_matching_sections_and_one_asym_att(): assert_almost_equal_verbose(temp_real_celsius, out["tmpf"].values, decimal=7) assert_almost_equal_verbose(temp_real_celsius, out["tmpb"].values, decimal=7) assert_almost_equal_verbose(temp_real_celsius, out["tmpw"].values, decimal=7) - pass def test_double_ended_fix_gamma_matching_sections_and_one_asym_att(): @@ -1379,7 +1366,6 @@ def test_double_ended_fix_gamma_matching_sections_and_one_asym_att(): assert_almost_equal_verbose(temp_real_celsius, out["tmpf"].values, decimal=7) assert_almost_equal_verbose(temp_real_celsius, out["tmpb"].values, decimal=7) assert_almost_equal_verbose(temp_real_celsius, out["tmpw"].values, decimal=7) - pass @pytest.mark.skip( @@ -1546,9 +1532,16 @@ def test_double_ended_exponential_variance_estimate_synthetic(): print("Real VAR: ", v1i**2, "Estimated VAR: ", v2i) assert_almost_equal_verbose(v1i**2, v2i, decimal=1) - pass + +def statsmodels_available(): + try: + import statsmodels # noqa: F401 + except ModuleNotFoundError: + return False + return True +@pytest.mark.skipif(not statsmodels_available(), reason="requires statsmodels!") @pytest.mark.slow # Execution time ~2 minutes. def test_estimate_variance_of_temperature_estimate(): import dask.array as da @@ -1699,8 +1692,6 @@ def test_estimate_variance_of_temperature_estimate(): desire2 = out["tmpw_var"].mean(dim="time") assert_almost_equal_verbose(actual[16:32], desire2[16:32], decimal=3) - pass - def test_single_ended_wls_estimate_synthetic(): """Checks whether the coefficients are correctly defined by creating a @@ -1773,8 +1764,6 @@ def test_single_ended_wls_estimate_synthetic(): assert_almost_equal_verbose(out["dalpha"].values, dalpha_p - dalpha_m, decimal=8) assert_almost_equal_verbose(out["tmpf"].values, temp_real - 273.15, decimal=4) - pass - def test_single_ended_wls_fix_dalpha_synthetic(): """Checks whether the coefficients are correctly defined by creating a @@ -1868,8 +1857,6 @@ def test_single_ended_wls_fix_dalpha_synthetic(): assert_almost_equal_verbose(out.alpha.values, x * (dalpha_p - dalpha_m), decimal=14) assert_almost_equal_verbose(out.tmpf.values, temp_real - 273.15, decimal=10) - pass - def test_single_ended_wls_fix_gamma_synthetic(): """Checks whether the coefficients are correctly defined by creating a @@ -1947,8 +1934,6 @@ def test_single_ended_wls_fix_gamma_synthetic(): assert_almost_equal_verbose(out.dalpha.values, dalpha_p - dalpha_m, decimal=10) assert_almost_equal_verbose(out.tmpf.values, temp_real - 273.15, decimal=8) - pass - def test_single_ended_wls_fix_gamma_fix_dalpha_synthetic(): """Checks whether the coefficients are correctly defined by creating a @@ -2027,8 +2012,6 @@ def test_single_ended_wls_fix_gamma_fix_dalpha_synthetic(): assert_almost_equal_verbose(out.dalpha.values, dalpha_p - dalpha_m, decimal=18) assert_almost_equal_verbose(out.tmpf.values, temp_real - 273.15, decimal=8) - pass - def test_single_ended_trans_att_synthetic(): """Checks whether the transient attenuation routines perform as intended, @@ -2500,10 +2483,8 @@ def test_single_ended_exponential_variance_estimate_synthetic(): print("Real VAR: ", v1i, "Estimated VAR: ", v2i_c) assert_almost_equal_verbose(v1i, v2i_c, decimal=1) - pass - print("hoi") - +@pytest.mark.skipif(not statsmodels_available(), reason="requires statsmodels!") def test_calibrate_wls_solver_procedures(): x = np.linspace(0, 10, 25 * 4) np.random.shuffle(x) diff --git a/tests/test_variance_stokes.py b/tests/test_variance_stokes.py index 5663e283..8377146e 100644 --- a/tests/test_variance_stokes.py +++ b/tests/test_variance_stokes.py @@ -52,7 +52,6 @@ def assert_almost_equal_verbose(actual, desired, verbose=False, **kwargs): desired2 = np.broadcast_to(desired, actual.shape) np.testing.assert_almost_equal(actual, desired2, err_msg=m, **kwargs) - pass @pytest.mark.slow # Execution time ~20 seconds @@ -241,8 +240,6 @@ def callable_st_var(stokes): decimal=2, ) - pass - @pytest.mark.slow # Execution time ~0.5 minute def test_variance_input_types_double(): @@ -490,8 +487,6 @@ def st_var_callable(stokes): decimal=2, ) - pass - @pytest.mark.slow # Execution time ~0.5 minute def test_double_ended_variance_estimate_synthetic(): @@ -672,8 +667,6 @@ def test_double_ended_variance_estimate_synthetic(): print("Real VAR: ", v1i**2, "Estimated VAR: ", float(v2i)) assert_almost_equal_verbose(v1i**2, v2i, decimal=2) - pass - def test_single_ended_variance_estimate_synthetic(): import dask.array as da @@ -798,8 +791,6 @@ def test_single_ended_variance_estimate_synthetic(): print("Real VAR: ", v1i**2, "Estimated VAR: ", float(v2i)) assert_almost_equal_verbose(v1i**2, v2i, decimal=2) - pass - @pytest.mark.skip(reason="Not enough measurements in time. Use exponential instead.") def test_variance_of_stokes(): @@ -818,8 +809,6 @@ def test_variance_of_stokes(): I_var, _ = variance_stokes_constant(st=ds_dask["st"], sections=sections) assert_almost_equal_verbose(I_var, correct_var, decimal=1) - pass - def test_variance_of_stokes_synthetic(): """ @@ -858,7 +847,6 @@ def test_variance_of_stokes_synthetic(): ) assert_almost_equal_verbose(test_st_var, yvar, decimal=1) - pass @pytest.mark.slow # Execution time ~20 seconds @@ -937,8 +925,6 @@ def test_variance_of_stokes_linear_synthetic(): assert_almost_equal_verbose(slope, var_slope, decimal=3) assert_almost_equal_verbose(offset, 0.0, decimal=0) - pass - @pytest.mark.slow # Execution time ~20 seconds def test_exponential_variance_of_stokes(): @@ -961,8 +947,6 @@ def test_exponential_variance_of_stokes(): ) assert_almost_equal_verbose(I_var, correct_var, decimal=5) - pass - def test_exponential_variance_of_stokes_synthetic(): """ @@ -1001,4 +985,3 @@ def test_exponential_variance_of_stokes_synthetic(): ) assert_almost_equal_verbose(test_st_var, yvar, decimal=1) - pass