-
Notifications
You must be signed in to change notification settings - Fork 52
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
Can't read some point group HDF5 datasets from EMsoft's dot product files #159
Comments
That looks like it'll be some fun string regrexing... Might be worth a minor refactor too given that we know what this edge case (re.search line returns None) is likely to be: point_group = re.search(r"\[([A-z0-9]+)\]", data_group["Point Group"][:][0].decode())
if point_group is not None:
point_group = point_group.group(1)
else:
raise ValueError('some useful error message that shows the difficult string') |
Definitely, thanks for the tip, @pc494! Will do that. |
hakonanes
added a commit
to hakonanes/orix
that referenced
this issue
Apr 19, 2021
Signed-off-by: Håkon Wiik Ånes <[email protected]>
6 tasks
EMsoft dot product file string: ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-3-474bb6bffba0> in <module>
1 xmap_au = io.load(os.path.join(dir_em, "austenite", "res_austenite.h5"))
2 xmap_fe = io.load(os.path.join(dir_em, "ferrite", "res_ferrite.h5"))
----> 3 xmap_chi = io.load(os.path.join(dir_em, "chi", "res_chi.h5"))
~/miniconda3/envs/kp-dev/lib/python3.8/site-packages/orix/io/__init__.py in load(filename, **kwargs)
121 reader = readers[0]
122
--> 123 return reader.file_reader(filename, **kwargs)
124
125
~/miniconda3/envs/kp-dev/lib/python3.8/site-packages/orix/io/plugins/emsoft_h5ebsd.py in file_reader(filename, refined, **kwargs)
67
68 # Some of the data needed to create a CrystalMap object
---> 69 phase_name, point_group, structure = _get_phase(phase_group)
70 data_dict = {
71 # Get map coordinates ("Y Position" data set is not correct in EMsoft as of
~/miniconda3/envs/kp-dev/lib/python3.8/site-packages/orix/io/plugins/emsoft_h5ebsd.py in _get_phase(data_group)
173 """
174 name = re.search(r"([A-z0-9]+)", data_group["MaterialName"][:][0].decode()).group(1)
--> 175 point_group = re.search(
176 r"\[([A-z0-9/]+)\]", data_group["Point Group"][:][0].decode()
177 ).group(1)
AttributeError: 'NoneType' object has no attribute 'group' |
This is the last issue I'd like to fix before I'm happy for the v0.8 release. |
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The EMsoft dot product file reader is not flexible enough to pick out the point group from this point group string "b'Monoclinic b (C2h) [2/m]'", and throws this error:
The text was updated successfully, but these errors were encountered: