asdf icon indicating copy to clipboard operation
asdf copied to clipboard

Replace pyyaml with ruamel.yaml

Open drdavella opened this issue 6 years ago • 7 comments

This PR closes #391. By updating ruamel.yaml it appears that we can remove some older logic in asdf that provided handling for omap types. It looks like pyyaml handled those in an idiosyncratic way, whereas ruamel.yaml handles them better (see https://github.com/yaml/pyyaml/issues/78).

This PR does not address #642. The solution does not appear to be straightforward and so it will need to be fixed in a separate PR.

drdavella avatar Apr 11 '19 17:04 drdavella

Hi there @drdavella :wave: - thanks for the pull request! I'm just a friendly :robot: that checks for issues related to the changelog. I help make sure that this pull request is milestoned and labeled correctly. This is mainly intended for the maintainers, so if you are not a maintainer you can ignore this, and a maintainer will let you know if any action is required on your part :smiley:.

Everything looks good from my point of view! :+1:

If there are any issues with this message, please report them here.

stsci-bot[bot] avatar Apr 11 '19 17:04 stsci-bot[bot]

Hi there @drdavella :wave: - thanks for the pull request! I'm just a friendly :robot: that checks for issues related to the changelog. I help make sure that this pull request is milestoned and labeled correctly. This is mainly intended for the maintainers, so if you are not a maintainer you can ignore this, and a maintainer will let you know if any action is required on your part :smiley:.

Everything looks good from my point of view! :+1:

If there are any issues with this message, please report them here.

stsci-bot[bot] avatar Apr 11 '19 17:04 stsci-bot[bot]

Codecov Report

Merging #677 into master will increase coverage by 0.14%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #677      +/-   ##
==========================================
+ Coverage   93.41%   93.55%   +0.14%     
==========================================
  Files          39       39              
  Lines        4341     4313      -28     
==========================================
- Hits         4055     4035      -20     
+ Misses        286      278       -8
Impacted Files Coverage Δ
asdf/yamlutil.py 99.18% <100%> (+1.26%) :arrow_up:
asdf/__init__.py 100% <100%> (+24%) :arrow_up:
asdf/block.py 95.59% <100%> (ø) :arrow_up:
asdf/schema.py 94.16% <100%> (ø) :arrow_up:
asdf/versioning.py 92.85% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 1d9a56c...b69c9c3. Read the comment docs.

codecov[bot] avatar Apr 11 '19 17:04 codecov[bot]

This looks awesome :smile: Do you have any indication if this has any performance impact one way or another?

Cadair avatar Apr 15 '19 08:04 Cadair

All the jwst package unit tests pass with this change. So we are 👍

jdavies-st avatar Apr 17 '19 21:04 jdavies-st

@Cadair I have not had time to look into performance yet. My intuition is that it will be no worse than pyyaml, but it should be measured.

drdavella avatar Apr 18 '19 13:04 drdavella

This isn't a great benchmark, but I did

%timeit asdf.test()

On this branch: 18.7 s ± 27.8 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)

On master: 18 s ± 32.9 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)

See this issue for related discussion. I'm not sure whether this is a strong enough reason to hold off on this PR, though.

drdavella avatar Apr 18 '19 18:04 drdavella

Closing. This has become too out of date and stale.

WilliamJamieson avatar Oct 26 '22 18:10 WilliamJamieson