pymatgen | Python Materials Genomics | Dataset library
kandi X-RAY | pymatgen Summary
kandi X-RAY | pymatgen Summary
Python Materials Genomics (pymatgen) is a robust materials analysis code that defines classes for structures and molecules with support for many electronic structure codes. It powers the Materials Project.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of pymatgen
pymatgen Key Features
pymatgen Examples and Code Snippets
from gaspy.tasks import schedule_tasks
from gaspy.gasdb import get_catalog_docs
from gaspy.tasks.metadata_calculators import CalculateAdsorptionEnergy
# Get all of the sites that we have enumerated
all_site_documents = get_catalog_docs()
# Pick th
from mpmorph.runners.amorphous_maker import get_random_packed
from mpmorph.workflows.converge import get_converge_wf
from fireworks import LaunchPad
structure = get_random_packed('Li', target_atoms=100)
spawner_args = {'rescale_params': {'beta': 5e
from mpmorph.workflows.converge import get_converge_wf
from pymatgen import MPRester
from fireworks import LaunchPad
mpr = MPRester()
structure = mpr.get_structure_by_material_id('mp-1143')
structure.make_supercell([3, 3, 3])
wf = get_converge_wf(s
Community Discussions
Trending Discussions on pymatgen
QUESTION
I'm using pymatgen, which has a class BaderAnalysis (https://github.com/materialsproject/pymatgen/blob/v2020.4.29/pymatgen/command_line/bader_caller.py). This class needs a executable called bader (binary from another source), so it checks if the file is there or not using which(). I do have the file and i can run the bader program manually, but I always get the error that the file isn't there. If I try the which() command manually it turns out that it only finds it with the prefix ./
...ANSWER
Answered 2020-May-08 at 23:56You would need to add your current directory to your PATH
environment variable. You can do it in your program invocation. E.g.,
QUESTION
I have installed the python package pymatgen and it perfectly works when I use it in my Jupyter notebooks. However, now I wanted to do the POSCAR setup as specified here: https://pymatgen.org/installation.html
But when I run: pmg config -p
(with my directories) in my command line (Linux), it can't find it and I get the error:
ANSWER
Answered 2020-Mar-21 at 13:46The issue was indeed that I was using the wrong python version to run the pmg-script (It was a work computer with many different python versions and I was using python 3.7.6 but there was an old python 2.7 set as default which was used when jus ran "python pmg"). I ran conda activate base
in my /home/username/anaconda3 and then python pmg etc.
and it worked.
QUESTION
ANSWER
Answered 2019-Nov-12 at 05:13Judging from your build IDs, you're working with an osx-64 platform. The dependency requirements for SymTopo look weird for all the osx-64 builds, specifically, they require pymatgen=2019.4.11.*
, which from searching Anaconda Cloud just doesn't exist. In the linux-64 builds, however, this requirement is pymatgen>=2019.4.11
, so I'm thinking the author has done this incorrectly, hence why you can't resolve a coherent package configuration.
Other than contacting the author and asking them to post some working builds, I think you have two possible courses of action:
- Force Install
- Using PyPI Builds
Either way, assume the resulting env will be fragile, so try to avoid any further unnecessary installations into it.
Force InstallIf we assume that the pymatgen=2019.4.11.*
really should be pymatgen>=2019.4.11
then you could just install all the prereqs (see YAML in next section), then use
QUESTION
We have existing code to get some material properties for many materials (>60,000).
...ANSWER
Answered 2019-Oct-15 at 08:34You don't need to query for each individual mpid. Your first code block already queries for the "cif"
information of all the materials!
All you need to do is to convert the cif strings to structures using PyMatGen:
QUESTION
sys.stdout.write("metadata-structure: %s\n"%(metadatastructure))
gives
...ANSWER
Answered 2019-Mar-01 at 09:38You can use a regular expression to look for _cell_length_a
(or any other key), followed by some spaces, and then capture whatever comes after that until the end of that line.
QUESTION
I was trying to analyze the result obtained by using pymatgen.analysis.local_env
module by using min_dist approach by using following script:
ANSWER
Answered 2019-Jan-25 at 17:03The second set of co-ordinates in square brackets are the fractional co-ordinates of that site with respect to the Structure's Lattice. Fractional co-ordinates wrap around periodic boundaries, so:
[-0.3863, -0.2759, 1.3863]
is equivalent to these co-ordinates in the [0,1) range:
[0.6137, 0.7241, 0.3863]
For technical reasons, fractional co-ordinates are not wrapped to [0, 1) by default however, since this information is meaningful for some simulation code. For practical purposes however, the easiest way to interpret them is in the [0, 1) range.
QUESTION
I am using a package that has operations inside the class (? not sure what either is really), and normally the data is called this way data[package.operation]
. Since I have to do multiple operations thought of shortening it and do the following
ANSWER
Answered 2018-Oct-29 at 18:13You can use getattr
in order to dynamically select attributes from objects (the Orbital
package in your case; for example getattr(Orbital, 's')
).
So your loop would be rewritten to:
QUESTION
How do I convert a primitive structure to the conventional standard representation with pymatgen?
...ANSWER
Answered 2017-Oct-05 at 21:51To do this, use the SpacegroupAnalyzer object.
QUESTION
So, using pymatgen, I have a structure object. What I want to do is get all of the bond angles within the structure. I could loop over every atom to get all bond angles, but this would include every atom, regardless of how far apart they are, which of course is a problem.
Now, I can find the neighbors of each central atom using the "get_neighbors" function, however, I'm not sure where to go from here, especially because the "get_angle" function takes integer values and not atomic site objects.
Below is the code I have thus far:
...ANSWER
Answered 2017-Feb-15 at 02:35Update:
So, I've figured out a way of doing this. I actually converted each neighboring atom into their Cartesian coordinates. Then, I subtracted the coordinates of the central atom to which the neighboring atoms are attached. Lastly, I found the angles by calculating the dot product of each two vectors divided by the product of their magnitudes, then taking the arc cosine of these values. The code which I used is below. This may not be the most elegant way of doing things, but it does get the job done. If anyone has improvements, feel free to comment.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pymatgen
You can use pymatgen like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page