Comments (5)
It should work, but it would not show the errors, I assume. The question is, whether such one-liner has to work, when this means that one has to call the gamma method without the user knowing it/ been able to prevent this.
from pyerrors.
I think corr.m_eff().some_func().show()
should still work just without displaying any y-errors for the individual data points. I see the convenience of this one-liner but I think having to call the gamma_method
explicitly leads to cleaner workflows as one should always manually monitor the autocorrelation function and the chosen window and adjust the parameters of the gamma_method
accordingly (there can be unpleasant surprises otherwise). The problem with implicit calls to the gamma_method
is that manually chosen values for say S
would be overwritten (which the user might not expect).
One thing we could think about is giving the show
method an additional parameter which triggers running the gamma_method
(with standard parameters but explicitly authorized by the user). This would alter your one-liner to
corr.m_eff().some_func().show(run_the_gamma_method_before_plotting=True)
or something like that (suggestions for a short but meaningful parameter name are appreciated).
from pyerrors.
I think you are right. The show method is really the only method that really needs to have this. I suggest to call it auto_gamma to imply that it uses the default parameters and to have it default to true, so one does not have to set it for every .show
.
from pyerrors.
an other solution might be to have a .apply_gamma
method, which returns a copy with the gamma method applied. This way one could decide to call it at any time in a one-liner eg.
corr.apply_gamma().some_func_needing_errors().m_eff().apply_gamma().show()
from pyerrors.
auto_gamma
sounds like a good solution, I can take care of that. I would prefer to default the parameter to False
. Otherwise the following could happen
corr.gamma_method(S=3.0)
corr.show()
print(corr[0].S)
> {'my_ensemble': 2.0}
which could be confusing to a user unfamiliar with the history of this.
We could also introduce a apply_gamma
method if that is useful for you. Although I have to say that corr.apply_gamma().some_func_needing_errors().m_eff().apply_gamma().show()
is not very readable 😅
from pyerrors.
Related Issues (20)
- numerical differentiation in derived_obs not working HOT 5
- Automatic windowing method fails for gapped and irregular chains HOT 4
- Issues with _filter_zeroes and Corr HOT 4
- Exception when applying .symmetric() to Corr containing None HOT 1
- Gamma_method() is broken for Obs that are NaN
- Multi-dimensional fits
- Bug coming from difference in search methods in sfcf inputs HOT 2
- `Corr.show()` draws prange in same color as error bars. HOT 1
- No dobs-related functions from the input submodule can be used HOT 1
- GEVP eigenvectors with errors HOT 7
- Warning in pandas tests
- Numpy 1.25 breaks a few linalg functions HOT 3
- Failing python 3.12 pytest workflow
- Duplicate data cause `gamma_method()` to fail with an unhelpful message HOT 3
- plot_history unexpected behaviour for gapped idl HOT 2
- read_hd5 in pyerrors 2.9.0 not fully backwards compatible to <=2.8.2 HOT 1
- Read specific interval with read_ms5_xsf() HOT 2
- Files keyword for multiple reps in read_sfcf HOT 2
- pyerrors does not work with the upcoming numpy 2 release HOT 7
- Corr.__getitem__ unexpected behaviour HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyerrors.