Git Product home page Git Product logo

pyscal / atomrdf Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 1.0 14.1 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 95.07% Python 4.93%
atomic-simulation computational-materials-science ontology rdm research-data-management atomic-structures

atomrdf's Introduction

atomRDF

Note

atomRDF was previously called pyscal-rdf.

codecov Conda Version PyPI - Python Version DOI

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

The package is currently under activate development and could be unstable .

More details coming soon...

Acknowledgements

This work is supported by the NFDI-Matwerk consortia.

Funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under the National Research Data Infrastructure โ€“ NFDI 38/1 โ€“ project number 460247524

atomrdf's People

Contributors

srmnitc avatar aazocar avatar ninadbhat avatar

Stargazers

 avatar  avatar Marian Bruns avatar Alejandra Gonzalez-Beltran avatar  avatar  avatar

Watchers

 avatar

Forkers

ninadbhat

atomrdf's Issues

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

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

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

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.

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

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

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

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

`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.

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.

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.