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

API Plot labels for XSData object; Other cleanups #402

Merged
merged 12 commits into from May 12, 2020

Conversation

drewejohnson
Copy link
Collaborator

This PR closes #401 by allowing the user to provide labels explicitly to the plot method. The following modes are available:

  1. None -> get descriptions from self.describe
  2. str -> only if a single MT is plotted
  3. mapping {mt: label} -> Provide a label for one or all MTs plotted. Does not have to contain all the reactions. Missing MTs will fall back to their description
  4. Iterable -> Must have length equal to MTs being plotted. Provide labels in the order of iteration

Some other key changes (all back-compatible)

  1. Add dictionary-like access to XSPlotReader - 2c13403
  2. Add __getitem__ and get to XSData - 9db302c
  3. Add a describe method for getting a reaction description - fca3588
  4. Start fading out metadata for both the reader fd1b21f and the data object e040b80. Prefer attributes of energies and majorant over metadata dictionary

Provides len, contains, getitem, get, keys, values, items

Add dedicated pytest test file for the xsplot reader
Index into the cross section data given a reaction
MT that exists in MT list. Emulates dictionary-like access,
but relies on finding the index from self.MT
Given a reaction MT, return it's corresponding description.
Works for positive or negative
The following modes are available:

1. None -> get descriptions from self.describe
2. str -> only if a single MT is plotted
3. mapping {mt: label} -> Provide a label for one or all MTs plotted.
   Does not have to contain all the reactions. Missing MTs will
   fall back to their description
4. Iterable -> Must have length equal to MTs being plotted. Provide
   labels in the order of iteration
Remove some unused PNGs as well
Tests dictionary access, plot labeling, and describe method
@drewejohnson drewejohnson added documentation API - Compatible Changes to our API that require no user actions labels May 4, 2020
@drewejohnson drewejohnson added this to the 0.9.3 milestone May 4, 2020
@drewejohnson drewejohnson added this to Review in Main May 4, 2020
@drewejohnson drewejohnson linked an issue May 4, 2020 that may be closed by this pull request
@drewejohnson drewejohnson merged commit cc56e45 into CORE-GATECH-GROUP:master May 12, 2020
@drewejohnson drewejohnson deleted the xsplot-labels branch May 12, 2020 01:41
drewejohnson added a commit to drewejohnson/serpent-tools that referenced this pull request May 23, 2020
Backport of features included since 0.9.3 release

Includes the following PRs

git log --online --pretty="%s" --merges 0.9.3...

Merge pull request CORE-GATECH-GROUP#407 from drewejohnson/fix-readme
Merge pull request CORE-GATECH-GROUP#406 from drewejohnson/r0.9.3
Merge pull request CORE-GATECH-GROUP#405 from nicoloabrate/master
Merge pull request CORE-GATECH-GROUP#404 from drewejohnson/update-git-attr
Merge pull request CORE-GATECH-GROUP#402 from drewejohnson/xsplot-labels
Merge pull request CORE-GATECH-GROUP#400 from drewejohnson/lib2-notes
Merge pull request CORE-GATECH-GROUP#399 from CORE-GATECH-GROUP/docs-sphinx-2.0
Merge pull request CORE-GATECH-GROUP#397 from drewejohnson/port-list-of-arrays
Merge pull request CORE-GATECH-GROUP#398 from drewejohnson/det-supers
Merge pull request CORE-GATECH-GROUP#396 from drewejohnson/df-arg-renaming
Merge pull request CORE-GATECH-GROUP#394 from drewejohnson/0.9.3-update-docs
Merge pull request CORE-GATECH-GROUP#395 from drewejohnson/hist-branch-dictlike
Merge pull request CORE-GATECH-GROUP#393 from drewejohnson/less-metadata
Merge pull request CORE-GATECH-GROUP#392 from drewejohnson/better-access
Merge pull request CORE-GATECH-GROUP#391 from drewejohnson/dep-dataframe
Merge pull request CORE-GATECH-GROUP#390 from drewejohnson/api-dep-attributes
Merge pull request CORE-GATECH-GROUP#388 from drewejohnson/xsplot-branch
Merge pull request CORE-GATECH-GROUP#378 from drewejohnson/better-build
Merge pull request CORE-GATECH-GROUP#376 from drewejohnson/unbundle-data-files
Merge pull request CORE-GATECH-GROUP#370 from drewejohnson/results-loa
Merge pull request CORE-GATECH-GROUP#369 from drewejohnson/merge-0.9.1-develop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API - Compatible Changes to our API that require no user actions documentation
Projects
Main
Review
Development

Successfully merging this pull request may close these issues.

ENH edit legend in xsreader.xsections.plot
2 participants