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

pyyaml 5.1 #97

Closed
henrikef opened this issue Mar 20, 2019 · 4 comments
Closed

pyyaml 5.1 #97

henrikef opened this issue Mar 20, 2019 · 4 comments
Labels

Comments

@henrikef
Copy link
Contributor

Some people have reported issues using the new version of pyyaml (5.1).

There are warnings like

/Users/Chang/miniconda3/envs/st_test/lib/python2.7/site-packages/astromodels/functions/function.py:120: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  function_definition = my_yaml.load(dct['__doc__'])

The code runs, but there are issues with parsing functions/loading models from file, leading to errors like

E                                  UnitsError: Looks like you didn't provide all the units, or you provided the wrong ones, when calling function Powerlaw

or

E               ModelSyntaxError: Function polarization, specified as shape for main of source one, is not a known function

during the tests.

Again, the underlying issues is changes in pyyaml, which break parsing of yml files in astromodels. See also yaml/pyyaml#265 . I suggest anyone experiencing issues downgrade to pyyaml==3.13 and yaml==0.1.7.

There are some more issues with the new version of pyyaml, see e.g. yaml/pyyaml#275 .

@henrikef
Copy link
Contributor Author

@cdr397

@grburgess
Copy link
Contributor

Hi! I've made the changes in the setup and this indeed solved the problem. However, I'm making that change in my branch for fixing the builds and there is still a weird issue with the conda builds for OSX. I'll keep working at it over the weekend.

@grburgess grburgess added the bug label Mar 23, 2019
@grburgess
Copy link
Contributor

solved

@henrikef
Copy link
Contributor Author

Was the solution to this just downgrading to pyyaml 3.13? If that's the case, I would think that eventually we'll need to update our code to work with the new yaml loaders. Or has that been done already?

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

No branches or pull requests

2 participants