Git Product home page Git Product logo

Comments (5)

s-kuberski avatar s-kuberski commented on July 28, 2024

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.

fjosw avatar fjosw commented on July 28, 2024

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.

JanNeuendorf avatar JanNeuendorf commented on July 28, 2024

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.

JanNeuendorf avatar JanNeuendorf commented on July 28, 2024

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.

fjosw avatar fjosw commented on July 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.