Giter VIP home page Giter VIP logo

pyscal / atomrdf Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 1.0 15.7 MB

atomRDF is a python tool for ontology-based creation, manipulation, and quering of structures. atomRDF uses the Computational Material Sample Ontology (CMSO).

Home Page: https://atomrdf.pyscal.org

License: MIT License

Jupyter Notebook 94.52% Python 5.48%
atomic-simulation atomic-structures computational-materials-science ontology rdm research-data-management

atomrdf's Introduction

pyscal - python Structural Environment Calculator

Tip

Check out pyscal3, a completely new pyscal which is faster and can handle a large number of atoms, with a much more user-friendly interface. This repository will continue receiving bug fixes, including any new raised issue. It will also be tested for new python versions. However, new features will only be added to pyscal3.

Complete documentation with examples available here.

pyscal is a python module for the calculation of local atomic structural environments including Steinhardt's bond orientational order parameters during post-processing of atomistic simulation data. The core functionality of pyscal is written in C++ with python wrappers using pybind11 which allows for fast calculations with possibilities for easy expansion in python.

Steinhardt's order parameters are widely used for identification of crystal structures. They are also used to identify if an atom is solid or liquid.

Installation

pyscal can be installed directly using conda by the following statement-

    conda install -c conda-forge pyscal

From repository

pyscal can be built from the repository by-

    git clone https://github.com/pyscal/pyscal.git
    cd pyscal
    python setup.py install --user

Citing the work

If you use pyscal in your work, the citation of the following article will be greatly appreciated:

Sarath Menon, Grisell Díaz Leines and Jutta Rogal (2019). pyscal: A python module for structural analysis of atomic environments. Journal of Open Source Software, 4(43), 1824, https://doi.org/10.21105/joss.01824

Works using pyscal

For a complete list of publications which used pyscal, see here.

atomrdf's People

Contributors

aazocar avatar ninadbhat avatar srmnitc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

ninadbhat

atomrdf's Issues

hasNumberOfAtoms field showing wrong numbers

Hi,

I am trying to delete an atom in the lattice and writing it to a turtle file. The final hasNumberOfAtoms recorded in the turtle file is incorrect.

Steps to reproduce

from pyscal_rdf import KnowledgeGraph, System
kg = KnowledgeGraph()

# Create Al lattice
struct_Al = System.create.element.Al(graph=kg)

# Write initial data to ttl file
kg.write("initial.ttl", format="ttl")

# Delete one atom
struct_Al.delete(indices=[0])

# Write final data to file
kg.write("final.ttl", format="ttl")

Version

pyscal3: 3.1.7
pyscal-rdf: 0.2.3

Issue

The hasNumberOfAtoms field in initial.ttl is 4, which is correct. However, the hasNumberOfAtoms field in final.ttl is 2, which seems incorrect.

Can you kindly look into this?

Thanks

System returned from get_system_from_sample does not have a graph variable in it

I am retrieving system object using get_system_from_sample, I expected system.graph to return a ref to the Knowledge graph. However it returns None.

Code to reproduce

from atomrdf import System, KnowledgeGraph
# Create data file
kg = KnowledgeGraph()
struct_Mg =  System.create.element.Mg(graph=kg, repetitions=(10,10,10))

kg.write("Mg.ttl", format="ttl")


# Read file
kg_2 = KnowledgeGraph(graph_file="Mg.ttl")
system = kg_2.get_system_from_sample(kg_2.samples[0])

print(system.graph)

Versions
atomrdf: 0.4.4
pyscal3: 3.1.12

Problem with query_sample function

when calling the query_sample() on the getting_started and grain_boundaries notebooks, one gets the following error:


UnboundLocalError Traceback (most recent call last)
Cell In[11], line 1
----> 1 res = g.query_sample(g.ontology.terms.cmso.hasAltName,
2 condition=(g.ontology.terms.cmso.hasAltName=='bcc'))
3 res

File ~/miniconda3/envs/rdf/lib/python3.11/site-packages/pyscal_rdf/graph.py:930, in RDFGraph.query_sample(self, destination, condition, return_query, enforce_types)
929 def query_sample(self, destination, condition=None, return_query=False, enforce_types=True):
--> 930 return self.auto_query(self.ontology.terms.cmso.AtomicScaleSample, destination,
931 condition=condition, return_query=return_query, enforce_types=enforce_types)

File ~/miniconda3/envs/rdf/lib/python3.11/site-packages/pyscal_rdf/graph.py:919, in RDFGraph.auto_query(self, source, destination, condition, return_query, enforce_types)
916 return res
917 else:
918 query = self.ontology.create_query(source, destination,
--> 919 condition=condition, enforce_types=val)
920 if return_query:
921 return query

UnboundLocalError: cannot access local variable 'val' where it is not associated with a value

Possible discussion aspects

  • Ontology network module sometimes has owl#Thing as domain. This is currently ignored. Instead, this should be assigned to all classes.
  • superproperties do not inherit domains from their subproperties. This is probably what is expected; nevertheless we should discuss if it makes sense for implementation purposes.

`process_structure` method does not work

process_structure in RDFGraph allows giving a filename instead of a system object for the calculations. However, there is possibility to specify the format. These method should be ideally removed.

Towards v1.0

Features

  • Add substitutional defects (#78 )
  • Add interstitial defects (#79 )
  • Wrapper for dislocations using atomman
  • Reach test coverage
  • Add ASE bulk as a direct option for structure creation
  • Add API docs
  • Add type hinting
  • lint with black
  • Add example notebooks

Volume calculation error

Creating a HCP Mg lattice with primitive=True and no repetitions shows a volume of "2993.63" (hasVolume field in turtle file). This is higher than expected as the cell lengths are (3.21,3.21,5.25).

Code to reproduce error:

kg = KnowledgeGraph()

struct_Mg = System.create.element.Mg(graph=kg, primitive=True)
kg.write("test_mg.ttl", format="ttl")

Versions
pyscal_rdf: 0.3.2

species is a necessary input in StructureGraph

species should be known for StructureGraph methods. In case of create_structure, this is currently optional. For read_structure, when the format itself does not specify species information, for example lammps-dump, this will throw an error.

LatticeAngle for HCP angle should be 90, 90, 120

Currently creating HCP lattice using primitive=False, leads to lattice angle 90,90,90. On discussion with @aazocar we think that lattice angle should still be 90,90,120. The cell angle however will still be 90,90,90 which is currently done correctly.

Code to reproduce:

kg = KnowledgeGraph()

struct_Mg = System.create.element.Mg(graph=kg,  repetitions=(10,10,10))
kg.write("test_mg.ttl", format="ttl")

Versions
pyscal_rdf : 0.3.2

Error when installing with conda

When creating an l12 structure, it gives the following error:

TypeError: System.init() got an unexpected keyword argument 'species'

The versions of pyscal and pyscal_rdf in conda are:

pyscal-rdf 0.1.5
pyscal3 3.1.1

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.