flav-io / flavio

A Python package for flavour physics phenomenology in the Standard model and beyond
http://flav-io.github.io/
MIT License
71 stars 62 forks source link

Fix yaml warnings #87

Closed MarkusPrim closed 5 years ago

MarkusPrim commented 5 years ago

Fixes Issue #85

Get rid of the deprecration warning explained here: https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation

The fix is minimal invasive. It explicitly performes what is done implicitly up until now, getting rid of the warning. When you run the tests now, there is still one yaml warning left from the wcxf package. I will create a pull request there to fix the issue.

Cheers, Markus

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 93.854% when pulling e9cb5c557e43f50a4c068d386fb8f2198d9e41ce on MarkusPrim:fix-yaml-warnings into 545ff8611f306ad31304a8beb91ccd8b7e8488de on flav-io:master.

DavidMStraub commented 5 years ago

Perfect, thanks!

DavidMStraub commented 5 years ago

I now realized that yaml.FullLoader is actually not defined in prior versions of PyYAML. This makes this fix not backward compatible. While this could be worked around by forcing the new PyYAML version as a dependency, I think this is problematic as many packages now seem to pin the dependency to the old PyYAML version to avoid breakages. So I decided to simply replace load by safe_load everywhere. This should get rid of the warning with PyYAML 5.1, but also work with the old version 3.12. I implemented this in 8e1d05a8ed2e72bb51ab18efff7fa558f20c4ddf.

MarkusPrim commented 5 years ago

@DavidMStraub Woops. I did not check for this but relied on the integration build instead. Sorry! Probably the same issue will appear in the wcxf package :(

DavidMStraub commented 5 years ago

No problem! I just applied the same fix in wcxf: https://github.com/wcxf/wcxf-python/commit/413eeb7ede8e8141a37dedd8fc24262b332890bb