-
Notifications
You must be signed in to change notification settings - Fork 50
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
add to_dict method to crystal_map to allow for easy extraction of tho… #457
base: develop
Are you sure you want to change the base?
Conversation
…se results that would be printed with __repr__
Thank you for this suggestion, @SteffenBrinckmann. A public method to extract all contents of a crystal map is a good idea. We already use such a private function in the orix HDF5 writer: orix/orix/io/plugins/orix_hdf5.py Lines 248 to 298 in 2e6f783
This function returns all contents of a crystal map, including the rotations. It doesn't calculate the phase fractions for you, though. Can you explain what you need this information for, specifically? I think making the mentioned private function a public crystal map method is the best solution. If you really need the phase fractions as well, we can add this to the dictionary if a boolean keyword is true, for example. What do you think? |
hey @hakonanes
best, Steffen |
I think that @SteffenBrinckmann has a good idea. If the function is private it would be good to add this function to the CrystalMap object. Something like a function @hakonanes @pc494 Thoughts? |
Haven't forgotten about this, but don't have time at the moment. A more thorough discussion about serialization (into dicts, I presume) would be good. |
add to_dict method to crystal_map to allow for easy extraction of those results that would be printed with repr
Description of the change
Progress of the PR
-> most tests were successful; some failed because of some 'url.requests' issue.
-> copied existing code: hence style should be ok (I don't have black installed and have no experience of using it)
Minimal example of the bug fix or new feature
For reviewers
__init__.py
.section in
CHANGELOG.rst
.__credits__
inorix/__init__.py
and in.zenodo.json
.