Giter Site home page Giter Site logo

Comments (4)

clelange avatar clelange commented on July 29, 2024

Hi Bill, thanks for creating this issue. Do you have an example of how you solved this that you could share so that it's easier to test and reproduce (and then to change eventually)?

from hepdata_lib.

GraemeWatt avatar GraemeWatt commented on July 29, 2024

Thanks for the feedback, but HEPData doesn't support string values for the uncertainties. Recommendations for how to encode missing bins are given in:

https://hepdata-submission.readthedocs.io/en/latest/data_yaml.html#uncertainties (second paragraph)

The implementation in hepdata_lib was done in PR #161, i.e. if all uncertainties are zero for a particular bin, then the errors key is omitted from the YAML output. The warning message was my suggestion to discourage empty bins if there is only one dependent variable. But for your use case where there are multiple dependent variables and a (different) subset of bins are empty for each dependent variable, it is legitimate to set uncertainties to zero for those bins and you should just ignore the warnings from hepdata_lib.

I don't think the behaviour of the hepdata_lib code needs to be changed, but there could be better documentation and perhaps an option could be added to suppress the warnings. I'll try to address these two points and I'll leave this issue open until they are addressed.

from hepdata_lib.

wmtford avatar wmtford commented on July 29, 2024

Thanks both. An example of the use case is Fig. 5, the second table, in [1]. A stand-alone notebook to reproduce that table, along with the needed input files, can be found in cernbox at [2]. From my perspective this works fine, other than that the warning messages seem to imply a problem.

The reason that the encoding of missing bins pointed to by Graeme doesn't work in the hepdata_lib implementation is that there uncertaintes are added, or not, for an entire column; we don't have access to treat some of the rows differently.

[1] https://www.hepdata.net/record/146018
[2] https://cernbox.cern.ch/s/8Nk392EQuLX8jJC

from hepdata_lib.

GraemeWatt avatar GraemeWatt commented on July 29, 2024

Bill, thank you for providing the detailed example. Unfortunately, it is a limitation of hepdata_lib that it is not possible to use a different treatment of uncertainties for different rows of a dependent variable. Your existing treatment is the best that can be done with the current code. I've opened a PR #251 that adds a paragraph of explanation to the end of the Uncertainties section of the documentation. I also added an option zero_uncertainties_warning (default value True) to the Variable class. In your example notebook, you could suppress the warnings using:

    # Dependent variable
    gy = Variable(axTitles[1][0], is_independent=False, is_binned=False, units=axTitles[1][1], zero_uncertainties_warning=False)

I also added a test that the errors key will be omitted if the uncertainties are zero, which should have been added when PR #161 was completed. Thanks again for the feedback.

from hepdata_lib.

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.