Skip to content

Conversation

srmnitc
Copy link
Member

@srmnitc srmnitc commented Jul 9, 2025

Rules

  • All classes are fully fledged pydantic objects
  • All classes should serialise and return themselves to their top level object
  • Serialisation can be called automatically or manually - decision needed
  • All data properties are fields
  • All classes should unserialise themselves
  • Should classes include reference to their top level object - decision needed
  • Named Individuals - do they create instance of themselves and assign as type - or no?

TODO

  • Make sure that to_graph method called on Activity does not create structures again
  • Implement Activity method on transformation
  • Create a new Workflow object and include parsing
  • Define wrappers for wf envs
  • update tests
  • update examples
  • what about substitute and interstitial?
  • check translate and shear and differences if needed
  • improvement to the 'id' field - if provided as user input - search kg and update existing record
  • Add PIDs everywhere

This pull request introduces several enhancements and refactors across the atomrdf library, focusing on modularizing the codebase, improving functionality for crystal structure generation, and standardizing I/O operations. Key changes include the addition of new utility functions, restructuring of I/O operations, and the introduction of new plotting and transformation capabilities.

New Features and Enhancements:

Crystal Structure Generation:

  • Added bulk and lattice functions in atomrdf/build/bulk.py to create and manage crystal structures with customizable parameters such as lattice constants, element types, and noise. These functions integrate with pyscal3 and atomrdf systems for seamless structure creation.

I/O Operations:

  • Introduced a new write function in atomrdf/io/write.py to handle file exports in various formats, including LAMMPS, POSCAR, and Quantum Espresso. This replaces the older _write_espresso implementation, offering better modularity and support for additional formats.
  • Added a read function in atomrdf/io/read.py to facilitate importing structures from multiple file formats, with options for specifying lattice properties and repetitions.

Plotting Capabilities:

  • Added plot and plot3d functions in atomrdf/io/plot.py for visualizing atomic structures. These functions support multiple styles, such as property-based coloring and boolean property visualization, leveraging pyscal3 and pyiron_atomistics.

Code Refactoring:

Modularization:

  • Refactored imports and utilities across the codebase for better organization and maintainability. For example:
    • Moved plotting and I/O utilities into dedicated modules (atomrdf/io/plot.py, atomrdf/io/write.py, atomrdf/io/read.py). [1] [2]
    • Simplified atomrdf/graph.py by replacing direct calls to to_file with the new write function.

Removal of Deprecated Code:

  • Removed the old _convert_tab_to_dict and write_espresso implementations from atomrdf/io.py, consolidating their functionality into the new write module.

Minor Updates:

  • Added utility function _declass in atomrdf/build/buildutils.py to standardize handling of special variables like Property objects.
  • Updated atomrdf/transform/__init__.py to re-export all transformations for easier access.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant