Skip to content

Removing duplicates in name, code/functionality and removing DPG folder - #209

Open
prabhath-c wants to merge 3 commits into
mainfrom
cleanup_duplicates
Open

Removing duplicates in name, code/functionality and removing DPG folder#209
prabhath-c wants to merge 3 commits into
mainfrom
cleanup_duplicates

Conversation

@prabhath-c

Copy link
Copy Markdown
Contributor

This pull request refactors several workflow and module imports to improve code organization and clarity. The main changes involve moving the GenericOptimizerSettings and ElementInput classes from the pyiron_nodes.dpg2026 namespace to the pyiron_nodes.atomistic.assyst namespace, updating their implementations, and adjusting all affected workflow scripts accordingly. Additionally, several plotting functions are streamlined for consistency, and redundant or outdated class definitions are removed from the assyst2 module.

Key changes:

Refactoring and import updates

  • Moved GenericOptimizerSettings from pyiron_nodes.dpg2026.atomistic.calculator.optimize to pyiron_nodes.atomistic.assyst.calculators, updated its implementation to use as_inp_dataclass_node, and updated all workflow scripts to import from the new location. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17]
  • Moved and refactored ElementInput from a dataclass in pyiron_nodes.dpg2026.atomistic.assyst.stoichiometry to a function in pyiron_nodes.atomistic.assyst.structures, updating its interface and return type. All affected workflows now import from the new location. [1] [2]

Code cleanup and removal

  • Removed duplicated or outdated definitions of GpawInput, GenericOptimizerSettings, and M3gnetConfig from pyiron_nodes.atomistic.assyst2.calculators to avoid confusion and redundancy. [1] [2]

Plotting function improvements

  • Updated plotting functions in pyiron_nodes.atomistic.assyst.plot to consistently use @as_function_node("plot") and return plt.show() instead of raw data, ensuring unified behavior and clearer output. [1] [2] [3] [4] [5]

Miscellaneous

  • Updated math utility import in Workflows/assyst.py to use pyiron_nodes.math_utils.Multiply instead of the deprecated pyiron_nodes.dpg2026.basic.math.Multiply.

These changes collectively improve code maintainability, modularity, and clarity across the affected modules and workflows.

@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.26%. Comparing base (523329f) to head (75b440e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #209      +/-   ##
==========================================
+ Coverage   41.07%   43.26%   +2.19%     
==========================================
  Files          93       88       -5     
  Lines       11670    11079     -591     
==========================================
  Hits         4793     4793              
+ Misses       6877     6286     -591     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Follow-up to 48831d6 (Tier A, byte-identical copies). Tier B covers the 12
node groups that shared a name across the structured tree and the dpg2026
fork but had since been edited on one side, so the two behaved differently
under one name.

Each group was reviewed individually against the two bodies, their call
sites and their post-migration git history; the surviving copy keeps the
canonical import path, so no consumer changes its imports.

  SplitTrainingAndTesting   linearfit.py       took fork's multi-line message
  SaveStructures            assyst2/structures took fork's `return df`
  IterToDataFrame           controls.py        kept: maintained line, 10 callers
  CalcPhaseDiagram          landau/plot.py     kept: no stray matplotlib import
  MinMaxIndices             linearfit.py       took fork's docstring, if/else
  TransitionTemperature     landau/plot.py     kept: returns Tm, not a Figure
  List5                     utilities.py       took fork's form (port -> list_out)
  PlotConcPhaseDiagram      landau/plot.py     kept + gained `concavity` arg
  IdealSolution             landau/phases.py   took fork's form
  LinePhase                 landau/phases.py   took fork's form
  PhasesFromDataFrame       landau/phases.py   took fork's version + make_phase,
                                               adding concentration_parameters=None
  PlotMuPhaseDiagram        landau/plot.py     took fork's form (port -> fig)

Two output ports were renamed as a result: List5 "list" -> "list_out" and
PlotMuPhaseDiagram "plot" -> "fig". Neither had a caller anywhere in the
repo or in the surrounding notebooks.

Cleanup of modules the deletions emptied. All five were unreferenced, are
not pulled in by any __init__.py, and their surviving private helpers are
duplicated in the live modules (_iterate_node in controls.py, guess_mu_range
in landau/plot.py):

  dpg2026/basic/list.py, basic/math.py, basic/loop.py
  dpg2026/thermodynamics/landau.py
  dpg2026/atomistic/fitting/dataset.py

The last one was a latent NameError rather than dead weight: its only
remaining function, make_linearfit, was byte-identical to the live copy in
linearfit.py and called six nodes that no longer existed in that module.

Also fixed the inverted border check in PlotMuPhaseDiagram, which queried
"not border" in the branch that had just established the column is absent.

Workflows were validated statically: every pyiron_nodes import in all 38
files resolves, and every node argument and .outputs.<label> reference
matches a real signature and port. Nothing was broken by the Tier B work.
The two electrochemistry workflows were already broken before it and are
repaired here - add_water_film/add_neon_layer were renamed to
AddWaterFilm/AddNeonLayer without the call sites following.

markdown_files/ documents the procedure so it can be repeated for Tier C
and Tier D, and the node conventions these decisions revealed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@prabhath-c prabhath-c changed the title Removed all exact duplicates (same name + same functionality) Removing duplicates in name, code/functionality and removing DPG folder Aug 20, 2026
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.

3 participants