Giter Site home page Giter Site logo

Comments (14)

AndreasAlbert avatar AndreasAlbert commented on September 3, 2024

Hi @rappoccio,

thanks for the report.
Could you check which PyYAML version you are using?
(Run pip show PyYAML in a terminal and copy the output).

Thanks

from hepdata_lib.

rappoccio avatar rappoccio commented on September 3, 2024

It's 4.1

Name: PyYAML
Version: 4.1
Summary: YAML parser and emitter for Python
Home-page: https://github.com/yaml/pyyaml
Author: Kirill Simonov
Author-email: [email protected]
License: MIT
Location: /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
Requires: 
Required-by: hepdata-lib

from hepdata_lib.

AndreasAlbert avatar AndreasAlbert commented on September 3, 2024

Ok, that is the problem. I can reproduce your problem if I install 4.1. I was previously running with 3.12, which worked fine. So if you want to have a quick workaround, you can try downgrading to 3.12.

As a way forward, I would propose to figure out what the right syntax for what we want to do is in 4.1, use that syntax, and update the setup requirements to make sure that at least this version is installed.

from hepdata_lib.

rappoccio avatar rappoccio commented on September 3, 2024

Aha, thanks for the quick checks! I can dig into this at some point soon if you don't get around to it.

from hepdata_lib.

AndreasAlbert avatar AndreasAlbert commented on September 3, 2024

@rappoccio If you want to take a look, that would be very welcome! The technical issue here is that we want the yaml package to be able to dump our default_dict just as it would usually be able to dump a normal python dict. I expect this to be reasonably straightforward to fix. Please assign the issue to yourself once you start working on it to keep track of what's going on. Otherwise @clelange or I will look into it.

from hepdata_lib.

rappoccio avatar rappoccio commented on September 3, 2024

When I get around to it I will put the assignment in.

from hepdata_lib.

clelange avatar clelange commented on September 3, 2024

For which command in the notebook does this error show? I think we can fix it by using either @staticmethod or @classmethod as discussed at https://stackoverflow.com/questions/40701142/typeerror-unbound-method-must-be-called-with-instance-as-first-argument-got-in/40701173
I'll look into it.

from hepdata_lib.

AndreasAlbert avatar AndreasAlbert commented on September 3, 2024

It happens any time we use yaml.dump to dump our defaultdicts.

from hepdata_lib.

AndreasAlbert avatar AndreasAlbert commented on September 3, 2024

If we end up switching pyyaml versions, we should revisit #18

from hepdata_lib.

clelange avatar clelange commented on September 3, 2024

Hmm, so the offender seems to be https://github.com/clelange/hepdata_lib/blob/master/hepdata_lib/__init__.py#L18

I've created a new branch (https://github.com/clelange/hepdata_lib/tree/test_yaml_dump) with a couple of additional tests and forcing PyYAML to version 4.1, but I cannot reproduce the error. Can one of you take it from here?

from hepdata_lib.

rappoccio avatar rappoccio commented on September 3, 2024

I still see the error here. Running out of battery though so can't debug right now haha.

from hepdata_lib.

AndreasAlbert avatar AndreasAlbert commented on September 3, 2024

Should be fixed in master now. @rappoccio please report if you encounter any more issues.

from hepdata_lib.

rappoccio avatar rappoccio commented on September 3, 2024

Thanks!

from hepdata_lib.

clelange avatar clelange commented on September 3, 2024

New version 0.2.2 is available on PyPI: https://pypi.org/project/hepdata_lib/

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.