Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User-friendly error when setting manually ds.sections #200

Closed
bdestombe opened this issue Aug 14, 2023 · 4 comments
Closed

User-friendly error when setting manually ds.sections #200

bdestombe opened this issue Aug 14, 2023 · 4 comments
Milestone

Comments

@bdestombe
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
Raise a user-friendly error when trying to set sections by letting the user know that sections are now set via the calibration functions. Maybe even raise a deprecated error

@bdestombe bdestombe added this to the v3.0.0 milestone Aug 14, 2023
@BSchilperoort
Copy link
Collaborator

I guess we can bring back the setter, but just make it throw an error.

@section.setter
def sections(self, value):
    msg = "Not possible anymore!"
    raise DeprecationError(msg)

@bdestombe
Copy link
Collaborator Author

Indeed :) Maybe a bit more friendly?

@section.setter
def sections(self, value):
    msg = "Not possible anymore. Instead, pass the sections as an argument to ds.dts.calibrate_single_ended() or ds.dts.calibrate_double_ended()."
    raise DeprecationError(msg)

@BSchilperoort
Copy link
Collaborator

It was just meant to be illustrative ;)
It's also best to split up the error message into multiple lines (with line breaks) so the message stays easily readable.

bdestombe added a commit that referenced this issue Oct 16, 2023
* User-friendly error when setting manually ds.sections

Solves #200

* User-friendly error when setting manually ds.sections

Solves #200

* Revert accidental double implementation of sections.setter

* Update documentation of datastore class

* Removed numbagg from dependencies

llvmlite is a pain to install with pip. Alternatively, it could be installed with conda

* Explicitly pass sections to more functions

* Format

* Moving away from calibrate_double_ended() inplace

self.update(out) is still in place at the end

* Refactored calibrate_double_ended covariance calculation

* Parallel testing

* refactored variance functions

* Include pyupgrade flag of ruff

* Refactored single ended routine p_val to params and moved averaging routines

* Update .gitignore

* Refactored calibration routines

In preparation of the accessor

* Please ruff

* Refactored Datastore class

* Updated sections example notebook

* Updated example notebooks

* Add api to docs

* Unfortenate formatting of notebooks

* Fixes to minor comments from Bart
bdestombe added a commit that referenced this issue Oct 16, 2023
* User-friendly error when setting manually ds.sections

Solves #200

* User-friendly error when setting manually ds.sections

Solves #200

* Revert accidental double implementation of sections.setter

* Update documentation of datastore class

* Removed numbagg from dependencies

llvmlite is a pain to install with pip. Alternatively, it could be installed with conda

* Explicitly pass sections to more functions

* Format

* Moving away from calibrate_double_ended() inplace

self.update(out) is still in place at the end

* Refactored calibrate_double_ended covariance calculation

* Parallel testing

* refactored variance functions

* Include pyupgrade flag of ruff

* Refactored single ended routine p_val to params and moved averaging routines

* Update .gitignore

* Refactored calibration routines

In preparation of the accessor

* Please ruff

* Refactored Datastore class

* Updated sections example notebook

* Updated example notebooks

* Add api to docs

* Unfortenate formatting of notebooks

* Split and move IO routines.

* Filter out some common warnings.

---------

Co-authored-by: Bas des Tombe <[email protected]>
@bdestombe bdestombe mentioned this issue Oct 21, 2023
3 tasks
bdestombe added a commit that referenced this issue Oct 27, 2023
* User-friendly error when setting manually ds.sections

Solves #200

* User-friendly error when setting manually ds.sections

Solves #200

* Revert accidental double implementation of sections.setter

* Update documentation of datastore class

* Removed numbagg from dependencies

llvmlite is a pain to install with pip. Alternatively, it could be installed with conda

* Explicitly pass sections to more functions

* Format

* Moving away from calibrate_double_ended() inplace

self.update(out) is still in place at the end

* Refactored calibrate_double_ended covariance calculation

* Parallel testing

* refactored variance functions

* Include pyupgrade flag of ruff

* Refactored single ended routine p_val to params and moved averaging routines

* Update .gitignore

* Refactored calibration routines

In preparation of the accessor

* Please ruff

* Refactored Datastore class

* Updated sections example notebook

* Updated example notebooks

* Add api to docs

* Unfortenate formatting of notebooks

* Estimate variance of stokes refactored

* single_ended_calibration and single_conf_ints working

* renamed conf_ints_single_ended to monte_carlo_single_ended

and calibration_single_ended to calibrate_ssingle_ended

* Removed DataStore from being used

* removed renaming_labels test

* conf_int_single renamed to monte_carlo_single

* Initial commit monte_carlo_double_ended

* Single and double ended calibration working and tested, including the monte carlo runs

* Got several variance_tests working

* Passing all variance tests

* Passing all tests except lint and examples

* Undo certain merge changes

* Minor cleanup

* Circumventing circular import DTSaccessor

* Update 03Define_sections.ipynb

* Update 04Calculate_variance_Stokes.ipynb

* Update 07Calibrate_single_ended.ipynb

* Update 08Calibrate_double_ended.ipynb

* calibration_double_ended to calibrate_double_ended

* Update 12Datastore_from_numpy_arrays.ipynb

* Update 13Fixed_parameter_calibration.ipynb

* Update 14Lossy_splices.ipynb

* Update 16Averaging_temperatures.ipynb

* Update 17Temperature_uncertainty_single_ended.ipynb

* Formatting of the entire repository

* Docs cleanup

* Fixed variance test

* Update test_variance_stokes.py

* Update 15Matching_sections.ipynb

* Updated 16Averaging notebook

* Update test_examples.py

* Update test_examples.py

* Fixing weirdly failing notebooks

* Update test_examples.py

* Rewritten test_notebooks routine

* Removed unused variable

* Remove metadata from notebook 12

* Delete 02Common_DataStore_functions_slice_mean_max_std_resample.ipynb

* Remove old reference to DataStore in notebooks

* Removed references to ds.variance_*() from docs

* Update src/dtscalibration/dts_accessor.py

Co-authored-by: Bart Schilperoort <[email protected]>

* Update test_examples.py

* Update docs

* Minimal attempt to fix docs

* Update README.rst

---------

Co-authored-by: Bart Schilperoort <[email protected]>
@BSchilperoort
Copy link
Collaborator

Fixed by #204

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants