Giter VIP home page Giter VIP logo

pymicro's Introduction

Pymicro is an open-source Python package to work with material microstructures and 3d data sets.

Read the Docs Travis CI License MIT

pymicro's People

Contributors

aldomarano avatar alexii-ann avatar basilemarchand avatar clementribart avatar daria-mesbah avatar heprom avatar jpcbertoldo avatar ngueninchault avatar rxzh avatar t20100 avatar tobyfrancis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pymicro's Issues

Pymicro readthedocs page failing to load

Hello,

I'm receiving the following error message when trying to visit http://pymicro.readthedocs.io/:

image

It seems like there is some sort of redirect loop, because the URL in my browser changes to this:

https://pymicro.readthedocs.io/projects/pymicro/projects/pymicro/projects/pymicro/projects/pymicro/projects/pymicro/projects/pymicro/projects/pymicro/projects/pymicro/projects/pymicro/projects/pymicro/projects/pymicro/projects/pymicro/projects/pymicro/projects/pymicro/projects/pymicro/projects/pymicro/projects/pymicro/projects/pymicro/projects/pymicro/projects/pymicro/

Cannot install pymicro

My system is Ubuntu 20.04 and the python version is python 3.8.
I tried many times, but couldn't install pymicro.
Can you provide detailed installation steps?

add citation for pymicro

An official citation for the pymicro package would allow the package to be cited as the author prefers.

Unable to run pymicro.crystal.texture.Polefigure

Dear pymicro team,

I am trying to understand pymicro and run the examples to plot pole figures. I am executing the examples:

Au_6grains_pole_figure.py
Cu_111_pole_figure.py
Cu_200_pole_figure.py

Specifically, I am executing the following commands:

from pymicro.crystal.microstructure import Microstructure, Grain, Orientation
from pymicro.crystal.texture import PoleFigure
from matplotlib import pyplot as plt, colors, cm

eulers = Orientation.read_euler_txt('examples/data/Cu_111.dat')
micro = Microstructure(name='Cu_111')
for index in eulers:
micro.grains.append(Grain(index, eulers[index]))

pf = PoleFigure(hkl='111', proj='stereo', microstructure=micro, verbose=False)

After executing of the last command, I get the following error:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "pymicro/crystal/texture.py", line 49, in __init__
self.set_hkl_poles(hkl)
File "pymicro/crystal/texture.py", line 80, in set_hkl_poles
hkl_planes = self.lattice.get_hkl_family(self.family)
File "pymicro/crystal/lattice.py", line 747, in get_hkl_family
planes = HklPlane.get_family(hkl, lattice=self, crystal_structure=self._symmetry)
File "pymicro/crystal/lattice.py", line 1196, in get_family
syms = Lattice.symmetry(crystal_structure)
File "pymicro/crystal/lattice.py", line 340, in symmetry
return crystal_structure.symmetry_operators()
AttributeError: 'str' object has no attribute 'symmetry_operators'

If I now run the command by explicitly specifying the crystal lattice as

pf = PoleFigure(hkl='111', proj='stereo', lattice='cubic',microstructure=micro, verbose=False)

I obtain the following error message:

Traceback (most recent call last): File "<stdin>", line 1, in <module> File "pymicro/crystal/texture.py", line 49, in __init__ self.set_hkl_poles(hkl) File "pymicro/crystal/texture.py", line 80, in set_hkl_poles hkl_planes = self.lattice.get_hkl_family(self.family) AttributeError: 'str' object has no attribute 'get_hkl_family'

I am not sure how to proceed, since the hkl family has been provided to the command.

Could you please help me.

Rgds,
Arun Prakash

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

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`

Method for plotting IFP orientation map

Hello,

I was wondering whether there is a method somewhere within pymicro for plotting an IPF-coloured orientation map of EBSD data loaded into the pymicro.crystal.microstructure.Microstructure class?

Thanks.

bug in vtkRotateActorAroundAxis

Henry,

Thanks for your reply. When I enter vtkpython euler_angles_anim.py the
animation comes up but the 3 vectors just each rotate fast around one axis.
The sample axes don't end up rotating to the crystal axes as it does when I
run the program from the documentation website. The z and x-axes rotate
back to their original positions and y rotates to the negative direction.
Do you know why? I cannot figure out where the problem is looking at the
code. The attached image shows the final configuration. Below is the
terminal output -

I am running Ubuntu 20 and Anaconda3 on a Asus laptop.

Thanks,

Don

after phi1, X axis is [-0.79652992 0.60459911 0. ]
after phi1 and Phi, Z axis is [0.32038872 0.42209655 0.8480481 ]
t=31, computed the_phi1 = 3.6
t=32, computed the_phi1 = 7.1
t=33, computed the_phi1 = 10.7
t=34, computed the_phi1 = 14.3
t=35, computed the_phi1 = 17.9
t=36, computed the_phi1 = 21.4
t=37, computed the_phi1 = 25.0
t=38, computed the_phi1 = 28.6
t=39, computed the_phi1 = 32.1
t=40, computed the_phi1 = 35.7
t=41, computed the_phi1 = 39.3
t=42, computed the_phi1 = 42.8
t=43, computed the_phi1 = 46.4
t=44, computed the_phi1 = 50.0
t=45, computed the_phi1 = 53.6
t=46, computed the_phi1 = 57.1
t=47, computed the_phi1 = 60.7
t=48, computed the_phi1 = 64.3
t=49, computed the_phi1 = 67.8
t=50, computed the_phi1 = 71.4
t=51, computed the_phi1 = 75.0
t=52, computed the_phi1 = 78.5
t=53, computed the_phi1 = 82.1
t=54, computed the_phi1 = 85.7
t=55, computed the_phi1 = 89.2
t=56, computed the_phi1 = 92.8
t=57, computed the_phi1 = 96.4
t=58, computed the_phi1 = 100.0
t=59, computed the_phi1 = 103.5
t=60, computed the_phi1 = 107.1
t=61, computed the_phi1 = 110.7
t=62, computed the_phi1 = 114.2
t=63, computed the_phi1 = 117.8
t=64, computed the_phi1 = 121.4
t=65, computed the_phi1 = 125.0
t=66, computed the_phi1 = 128.5
t=67, computed the_phi1 = 132.1
t=68, computed the_phi1 = 135.7
t=69, computed the_phi1 = 139.2
t=70, computed the_phi1 = 142.8
end of animation loop, exiting...

  • <)))**)><

  • <))))>< <))))>< *
    Protect Our Oceans

On Wed, May 13, 2020 at 10:03 AM Henry Proudhon [email protected]
wrote:

Hi donwerder, sorry I did not see your issue sooner. if you run anaconda3
it should all be fine. first try to lunch an ipython shell to verify that
vtk is install (tifffile is included as an external tool in pymicro):

import vtk
if this works then you just have to add pymicro to your python path. This
is a standard practice (using for instance the PYTHONPATH environment
variable). Then verify that you can import pymicro:
from pymicro.crystal.lattice import Lattice
and you should be good to go.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#3 (comment), or
unsubscribe
https://github.com/notifications/unsubscribe-auth/APF6UECNGNHKML443DRF5FDRRKSD3ANCNFSM4MIV6BUA
.

Originally posted by @donwerder in #3 (comment)

Errors when run example 'Cu_111_pole_figure.py'

Dear developers
Thanks for creating the package which is exactly what I need for my project. However, when I tried to run the example Cu_111_pole_figure.py, it shows errors below ( I'm using python 3.6 on Pycharm on Windows 10). Really appreciate it if you can give me some feedback.

Regards

E:\untitled\venv\Scripts\python.exe E:/untitled/test.py
Traceback (most recent call last):
File "E:/untitled/test.py", line 13, in
micro = Microstructure(name='Cu_111')
File "F:\pymicro\pymicro\crystal\microstructure.py", line 1452, in init
overwrite_hdf5, autodelete, **keywords)
File "F:\pymicro\pymicro\core\samples.py", line 218, in init
self._init_file_object(sample_name, sample_description, **keywords)
File "F:\pymicro\pymicro\core\samples.py", line 1712, in _init_file_object
self.h5_dataset = tables.File(self.h5_file, mode='r+')
File "C:\Users\fangc\AppData\Local\Programs\Python\Python36\lib\site-packages\tables\file.py", line 778, in init
self._g_new(filename, mode, **params)
File "tables\hdf5extension.pyx", line 492, in tables.hdf5extension.File._g_new
tables.exceptions.HDF5ExtError: HDF5 error back trace

File "D:\pytables_hdf5\CMake-hdf5-1.10.5\hdf5-1.10.5\src\H5F.c", line 509, in H5Fopen
unable to open file
File "D:\pytables_hdf5\CMake-hdf5-1.10.5\hdf5-1.10.5\src\H5Fint.c", line 1652, in H5F_open
unable to read superblock
File "D:\pytables_hdf5\CMake-hdf5-1.10.5\hdf5-1.10.5\src\H5Fsuper.c", line 623, in H5F__super_read
truncated file: eof = 96, sblock->base_addr = 0, stored_eof = 2048

End of HDF5 error back trace

Unable to open/create file 'Cu_111_data.h5'
Exception ignored in: <object repr() failed>
Traceback (most recent call last):
File "F:\pymicro\pymicro\core\samples.py", line 230, in del
self.sync()
File "F:\pymicro\pymicro\core\samples.py", line 478, in sync
self.add_attributes(dic=self.content_index, nodename='/Index')
AttributeError: 'Microstructure' object has no attribute 'content_index'

VTK and tifffile in anaconda3

This might not be the appropriate forum but I don't know where else to go with this question. I have installed pymicro but the module for VTK and tifffile are not found. I have tifffile and VTK8.2 installed in Anaconda3. How do I get pymicro to use those? Thanks.

issue with tutorial "contour_pole_figure.py"

Dear Developers,

I'm using python 3.8 and pymicro 0.51 and I'm trying to test the tutorial file "contour_pole_figure.py" but the following error is triggered. I guess the whole "grain" object structure changed and is not addressed correctly anymore in the old tutorial file.
Could you please provide assistance?

Many thanks in advance and best regards
Florian

fg@ubuntu:~/Programming/pymicro$ /bin/python3 /home/fg/Programming/pymicro/contour_pole_figure.py
Traceback (most recent call last):
File "/home/fg/.local/lib/python3.8/site-packages/tables/table.py", line 2216, in append
iflavor = flavor_of(rows)
File "/home/fg/.local/lib/python3.8/site-packages/tables/flavor.py", line 194, in flavor_of
raise TypeError(
TypeError: objects of type Grain are not supported in this context, sorry; supported objects are: NumPy array, record or scalar; homogeneous list or tuple, integer, float, complex or bytes

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/fg/Programming/pymicro/contour_pole_figure.py", line 14, in
micro.grains.append(Grain(i + 1, eulers[i + 1]))
File "/home/fg/.local/lib/python3.8/site-packages/tables/table.py", line 2223, in append
raise ValueError("rows parameter cannot be converted into a "
ValueError: rows parameter cannot be converted into a recarray object compliant with table '/GrainData/GrainDataTable (Table(0,)) '''. The error was: <objects of type Grain are not supported in this context, sorry; supported objects are: NumPy array, record or scalar; homogeneous list or tuple, integer, float, complex or bytes>
Closing remaining open files:test_data.h5...done
Exception ignored in: <function SampleData.del at 0x7f595c471310>
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/pymicro/core/samples.py", line 230, in del
File "/usr/local/lib/python3.8/dist-packages/pymicro/core/samples.py", line 478, in sync
File "/usr/local/lib/python3.8/dist-packages/pymicro/core/samples.py", line 973, in add_attributes
File "/usr/local/lib/python3.8/dist-packages/pymicro/core/samples.py", line 1100, in get_node
File "/usr/local/lib/python3.8/dist-packages/pymicro/core/samples.py", line 1987, in _name_or_node_to_path
File "/home/fg/.local/lib/python3.8/site-packages/tables/file.py", line 2049, in contains
File "/home/fg/.local/lib/python3.8/site-packages/tables/file.py", line 1628, in get_node
File "/home/fg/.local/lib/python3.8/site-packages/tables/file.py", line 2150, in _check_open
tables.exceptions.ClosedFileError: the file object is closed

An error of example

When I run the example atomic_structure_factor.py, the terminal reports an error:

ModuleNotFoundError: No module named'skimage'

and I cannot install module through conda or pip.

Issue of Microstructure class

Dear developers
Thank you very much for your previous help. I tried the 0.5.1 vision and the example "Au_6grains_pole_figure.py". However, it still shows the same error as below. Really appreciate it if you can help with it. I use pycharm python 3.7 in windows 10.
Thanks.

Regards
Chizhou

E:\untitled1\venv\Scripts\python.exe E:/untitled1/test.py
Traceback (most recent call last):
File "E:/untitled1/test.py", line 15, in
micro = Microstructure(name='Au_6grains')
File "F:\pymicro\pymicro\crystal\microstructure.py", line 1454, in init
overwrite_hdf5, autodelete, **keywords)
File "F:\pymicro\pymicro\core\samples.py", line 218, in init
self._init_file_object(sample_name, sample_description, **keywords)
File "F:\pymicro\pymicro\core\samples.py", line 1718, in _init_file_object
self._init_data_model()
File "F:\pymicro\pymicro\core\samples.py", line 1782, in _init_data_model
indexname=key)
File "F:\pymicro\pymicro\core\samples.py", line 851, in add_data_array
self.add_attributes(dic={'empty': True}, nodename=name)
File "F:\pymicro\pymicro\core\samples.py", line 973, in add_attributes
Node = self.get_node(nodename)
File "F:\pymicro\pymicro\core\samples.py", line 1116, in get_node
node = self.h5_dataset.get_node(node_path)
File "E:\untitled1\venv\lib\site-packages\tables\file.py", line 1642, in get_node
node = self._get_node(nodepath)
File "E:\untitled1\venv\lib\site-packages\tables\file.py", line 1590, in _get_node
node = self._node_manager.get_node(nodepath)
File "E:\untitled1\venv\lib\site-packages\tables\file.py", line 432, in get_node
node = self.node_factory(key)
File "E:\untitled1\venv\lib\site-packages\tables\group.py", line 1178, in _g_load_child
node_type = self._g_check_has_child(childname)
File "E:\untitled1\venv\lib\site-packages\tables\group.py", line 395, in _g_check_has_child
% (self._v_pathname, name))
tables.exceptions.NoSuchNodeError: group / does not have a child named /CellData\mask
Closing remaining open files:Au_6grains_data.h5...done
Exception ignored in: <function SampleData.del at 0x000001B2A8CA20D8>
Traceback (most recent call last):
File "F:\pymicro\pymicro\core\samples.py", line 230, in del
self.sync()
File "F:\pymicro\pymicro\core\samples.py", line 478, in sync
self.add_attributes(dic=self.content_index, nodename='/Index')
File "F:\pymicro\pymicro\core\samples.py", line 973, in add_attributes
Node = self.get_node(nodename)
File "F:\pymicro\pymicro\core\samples.py", line 1100, in get_node
node_path = self._name_or_node_to_path(name)
File "F:\pymicro\pymicro\core\samples.py", line 1987, in _name_or_node_to_path
if self.h5_dataset.contains(name_tmp):
File "E:\untitled1\venv\lib\site-packages\tables\file.py", line 2049, in contains
self.get_node(path)
File "E:\untitled1\venv\lib\site-packages\tables\file.py", line 1628, in get_node
self._check_open()
File "E:\untitled1\venv\lib\site-packages\tables\file.py", line 2150, in _check_open
raise ClosedFileError("the file object is closed")
tables.exceptions.ClosedFileError: the file object is closed

Process finished with exit code 1

No module named 'BasicTools'

After I download the pymicro and set PYTHONPATH, I simply run an example of field_ipf.py, and the error occurs: File "../pymicro/pymicro/core/samples.py",line 23, in from BasicTools.Containers.ConstantRectilinearMesh import (
ModuleNotFoundError: No module named ‘BasicTools'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.