heprom / pymicro

A Python package to work with material microstructures and 3d data sets
http://pymicro.readthedocs.io
MIT License
42 stars 22 forks source link

NoSuchNodeError: group ``/`` does not have a child named ``/CellData\grain_map`` #19

Closed KrugME closed 2 years ago

KrugME commented 3 years ago

Hello / Bonjour!

I am attempting to use pymicro to generate pole figures from a table of Euler angles, and I've newly installed pymicro. I am attempting to run the example code Au_6grains_pole_figure.py, and encountering the error shown in the subject. The full output is shown below the ===.

My system info:

MS Windows 10 Enterprise Version 10.0.19041 Build 19041 python sys.version '3.7.4 (default, Aug 9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)]' pymicro downloaded via: git clone http://github.com/heprom/pymicro

Thank you for any help you are able to provide.

=========================================================== micro = Microstructure(name='Au_6grains', overwrite_hdf5=True) Traceback (most recent call last):

File "", line 1, in micro = Microstructure(name='Au_6grains', overwrite_hdf5=True)

File "C:\Users\Public\Anaconda\envs\DoE\lib\site-packages\pymicro\crystal\microstructure.py", line 1603, in init after_file_open_args=after_file_open_args)

File "C:\Users\Public\Anaconda\envs\DoE\lib\site-packages\pymicro\core\samples.py", line 150, in init self._init_file_object(sample_name, sample_description)

File "C:\Users\Public\Anaconda\envs\DoE\lib\site-packages\pymicro\core\samples.py", line 3034, in _init_file_object self._init_data_model()

File "C:\Users\Public\Anaconda\envs\DoE\lib\site-packages\pymicro\core\samples.py", line 3093, in _init_data_model indexname=key)

File "C:\Users\Public\Anaconda\envs\DoE\lib\site-packages\pymicro\core\samples.py", line 1199, in add_field self.add_attributes(Attribute_dic, nodename=indexname)

File "C:\Users\Public\Anaconda\envs\DoE\lib\site-packages\pymicro\core\samples.py", line 1636, in add_attributes Node = self.get_node(nodename)

File "C:\Users\Public\Anaconda\envs\DoE\lib\site-packages\pymicro\core\samples.py", line 2319, in get_node node = self.h5_dataset.get_node(node_path)

File "C:\Users\Public\Anaconda\envs\DoE\lib\site-packages\tables\file.py", line 1651, in get_node node = self._get_node(nodepath)

File "C:\Users\Public\Anaconda\envs\DoE\lib\site-packages\tables\file.py", line 1599, in _get_node node = self._node_manager.get_node(nodepath)

File "C:\Users\Public\Anaconda\envs\DoE\lib\site-packages\tables\file.py", line 437, in get_node node = self.node_factory(key)

File "C:\Users\Public\Anaconda\envs\DoE\lib\site-packages\tables\group.py", line 1181, in _g_load_child node_type = self._g_check_has_child(childname)

File "C:\Users\Public\Anaconda\envs\DoE\lib\site-packages\tables\group.py", line 398, in _g_check_has_child % (self._v_pathname, name))

NoSuchNodeError: group / does not have a child named `/CellData\grain_map

heprom commented 3 years ago

Hi, thank you for reporting this. I have look it up and it is due to a bug in pymicro on windows constructing the path in the HDF5 files. Should be easy to fix. I will keep you posted.

heprom commented 3 years ago

It should be fixed now, could you try to clone the latest version of the devel branch? that being said the code has not yet been tested on windows but we are starting to look into it since several users requested it. I'm therefore interested in your feedback.

KrugME commented 2 years ago

Apologies for the delay in communications while I was on holiday for Thanksgiving. Thank you for your prompt attention to this issue. I cloned the latest version from the devel branch as you directed, and indeed that did resolve the error I was having. Thank you! I am now stuck at the line:

image_name = os.path.splitext(file)[0] + '.png'

which results in:

NameError: name 'file' is not defined

I can probably resolve this tomorrow once I've had some sleep. I will report back to let you know for sure.

KrugME commented 2 years ago

Please disregard my previous comment, I understand what was happening now. I have successfully reproduced your example. Many thanks again for your help.

heprom commented 2 years ago

Glad this is working, please do not hesitate to report any issue or feature request. The code is evolving quite fast these days :)

KrugME commented 2 years ago

What is the preferred method for making feature requests? I have several small suggestions related to texture / pole figure representation.

heprom commented 2 years ago

open new issues, preferably one per item and I'll mark them as feature requests. If you develop some code, file a pull request so the code can be easily examined and then merged into the project. Thanks

KrugME commented 2 years ago

Thank you - I will certainly at minimum open an issue to name the items. I am looking into what my organization allows in terms of pushing code, and if permitted I will do so.