Skip to content

chore: reorg to add amorphouspy.pipelines#345

Merged
ltalirz merged 2 commits into
mainfrom
chore/reorganize-code
May 15, 2026
Merged

chore: reorg to add amorphouspy.pipelines#345
ltalirz merged 2 commits into
mainfrom
chore/reorganize-code

Conversation

@ltalirz
Copy link
Copy Markdown
Contributor

@ltalirz ltalirz commented May 11, 2026

In preparation of addition of an amorphouspy.pipelines subpackage, which will depend on executorlib, we reorganize the code in amorphouspy.

In particular, we restructure the amorphouspy package from a flat/mixed layout into a
consistent domain-driven hierarchy that mirrors the scientific workflow:

atoms/ — atomic-level utilities (neighbors, mass, element types)
fabrication/ — glass structure creation (composition, density, geometry,
planner, melt-quench protocols & simulation)
lammps/ — LAMMPS infrastructure (runner, MD wrapper, I/O, potentials)
properties/ — computation of glass properties (CTE, elastic, viscosity,
structural/ for RDF, rings, Qn, bond angles, cavities,
structure factor, projected RDF)
pipelines/ — workflow orchestration (placeholder)
io.py — generic file writers (XYZ, distributions)

Key changes:

  • _utils.py → split into atoms/mass.py and atoms/shared.py
  • neighbors.py → atoms/neighbors.py
  • structure_generation/ → fabrication/
  • simulation/meltquench*.py → fabrication/
  • simulation/lammps.py → lammps/runner.py
  • simulation/md.py → lammps/md.py
  • io_utils.py → split into io.py (generic writers) and lammps/io.py (LAMMPS readers)
  • potentials/ → lammps/potentials/
  • structure_characterization/ → properties/structural/
    (radial_distribution_functions.py → rdf.py,
    bond_angle_distribution.py → bond_angles.py,
    qn_network_connectivity.py → qn.py,
    pipeline.py → all.py)
  • simulation/cte.py → properties/cte.py
  • structure_characterization/cte.py → properties/cte_analysis.py
  • simulation/elastic.py → properties/elastic.py
  • simulation/viscosity.py → properties/viscosity.py

All imports updated across core library, tests, API package, notebooks,
and documentation. Updated pyproject.toml per-file-ignores to match new
paths. No backward-compatibility shims.

All 631 core tests and 85 API tests pass.

@github-actions github-actions Bot added the type: ci Changelog: CI / chore changes (Maintenance) label May 11, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@ltalirz ltalirz closed this May 11, 2026
ltalirz added 2 commits May 15, 2026 16:55
In preparation of addition of an `amorphouspy.parallel` subpackage,
which will depend on `executorlib`, we reorganize the code in
`amorphouspy`.
In particular

- `workflows/` is renamed to `simulations/` in accordance with the docs
  and to avoid confusion with explicit workflow code that depends on
`executorlib`
- `parallel/` folder stub is introduced
- `analysis/` becomes `structure_characterization`
- `structure/` becomes `structure_generation`
- several other cleanups

```
amorphouspy/
├── __init__.py
├── _utils.py                        # merged mass.py + shared.py
├── neighbors.py
├── io/
│   ├── __init__.py
│   └── lammps.py                    # was io_utils.py
├── parallel/
│   └── __init__.py                  # stub for future executorlib code
├── potentials/                      # unchanged
├── simulation/                      # was workflows/
│   ├── lammps.py                    # was workflows/shared.py
│   ├── md.py
│   ├── meltquench.py
│   ├── meltquench_protocols.py
│   ├── cte.py
│   ├── cte_helpers.py
│   ├── elastic.py                   # was elastic_mod.py
│   └── viscosity.py
├── structure_characterization/      # was analysis/
│   ├── averaging.py
│   ├── bond_angle_distribution.py
│   ├── cavities.py
│   ├── cte.py
│   ├── pipeline.py                  # was workflows/structural_analysis.py
│   ├── projected_rdf.py
│   ├── qn_network_connectivity.py
│   ├── radial_distribution_functions.py
│   ├── rings.py
│   └── structure_factor.py
└── structure_generation/            # was structure/
    ├── composition.py
    ├── density.py
    ├── geometry.py
    └── planner.py
```
Restructure the amorphouspy package from a flat/mixed layout into a
consistent domain-driven hierarchy that mirrors the scientific workflow:

  atoms/        — atomic-level utilities (neighbors, mass, element types)
  fabrication/  — glass structure creation (composition, density, geometry,
                  planner, melt-quench protocols & simulation)
  lammps/       — LAMMPS infrastructure (runner, MD wrapper, I/O, potentials)
  properties/   — computation of glass properties (CTE, elastic, viscosity,
                  structural/ for RDF, rings, Qn, bond angles, cavities,
                  structure factor, projected RDF)
  pipelines/    — workflow orchestration (placeholder)
  io.py         — generic file writers (XYZ, distributions)

Key changes:
- _utils.py → split into atoms/mass.py and atoms/shared.py
- neighbors.py → atoms/neighbors.py
- structure_generation/ → fabrication/
- simulation/meltquench*.py → fabrication/
- simulation/lammps.py → lammps/runner.py
- simulation/md.py → lammps/md.py
- io_utils.py → split into io.py (generic writers) and lammps/io.py (LAMMPS readers)
- potentials/ → lammps/potentials/
- structure_characterization/ → properties/structural/
  (radial_distribution_functions.py → rdf.py,
   bond_angle_distribution.py → bond_angles.py,
   qn_network_connectivity.py → qn.py,
   pipeline.py → all.py)
- simulation/cte.py → properties/cte.py
- structure_characterization/cte.py → properties/cte_analysis.py
- simulation/elastic.py → properties/elastic.py
- simulation/viscosity.py → properties/viscosity.py

All imports updated across core library, tests, API package, notebooks,
and documentation. Updated pyproject.toml per-file-ignores to match new
paths. No backward-compatibility shims.

All 631 core tests and 85 API tests pass.
@ltalirz ltalirz reopened this May 15, 2026
@ltalirz ltalirz force-pushed the chore/reorganize-code branch from 11d27a5 to 3f7ea08 Compare May 15, 2026 15:41
@ltalirz ltalirz added integration Tag a PR with this to run integration tests type: breaking Changelog: breaking change → bumps major version labels May 15, 2026
@ltalirz
Copy link
Copy Markdown
Contributor Author

ltalirz commented May 15, 2026

@Atilaac This is a breaking change.

If we keep the breaking label on the PR, it will result in the next release being 1.0 - I personally don't care about this; if you would like to avoid it, feel free to remove the label again

@ltalirz ltalirz requested a review from Atilaac May 15, 2026 15:45
@Atilaac
Copy link
Copy Markdown
Contributor

Atilaac commented May 15, 2026

Thanks a lot @ltalirz! I will take an in depth look later. I will remove the breaking label for me this should matter more when we publish the paper and we have our first 1.0.0 release. For now as we do not have users at scale, it is not important.

@Atilaac Atilaac removed the type: breaking Changelog: breaking change → bumps major version label May 15, 2026
@ltalirz
Copy link
Copy Markdown
Contributor Author

ltalirz commented May 15, 2026

Ok, fine with me.

No need to spend too much time on the review - if you spot anything you really don't like, let me know.

Otherwise: the tests pass and this is does not have to be the final layout, we can always evolve.

@ltalirz ltalirz changed the title chore: reorg to add amorphouspy.parallel chore: reorg to add amorphouspy.pipelines May 15, 2026
Copy link
Copy Markdown
Contributor

@Atilaac Atilaac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might consider dropping io.py. I don't think it is needed. I am approving this for now.

@ltalirz
Copy link
Copy Markdown
Contributor Author

ltalirz commented May 15, 2026

We might consider dropping io.py. I don't think it is needed. I am approving this for now.

I'll take care of it in a follow-up, when I start filling the pipelines folder

@ltalirz ltalirz merged commit 7022997 into main May 15, 2026
14 checks passed
@ltalirz ltalirz deleted the chore/reorganize-code branch May 15, 2026 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration Tag a PR with this to run integration tests type: ci Changelog: CI / chore changes (Maintenance)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should workflow logic stay inside API code or move into amorphouspy package?

2 participants