Skip to content

Commit 91c865a

Browse files
committed
refactor: reorganize package structure for clarity and separation of concerns
- move axes module into levels package - split logging into core infrastructure module - separate results reporting into results package - remove redundant entropy_* naming - rename group_molecules to molecules/grouping - introduce cli entrypoint and __main__ module - reorganize config into argparse + runtime - normalize module names across levels and entropy No functional changes.
1 parent 222a09f commit 91c865a

44 files changed

Lines changed: 46 additions & 58 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎CodeEntropy/__main__.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from __future__ import annotations
2+
3+
from CodeEntropy.cli import main
4+
5+
if __name__ == "__main__":
6+
main()
Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,27 @@
11
"""Command-line entry point for CodeEntropy.
22
3-
This module provides the program entry point used to run the multiscale cell
3+
This module provides the CLI entry point used to run the multiscale cell
44
correlation entropy workflow.
55
66
The entry point is intentionally small and only responsible for:
77
1) Creating a job folder.
8-
2) Constructing a :class:`~CodeEntropy.config.run.RunManager`.
8+
2) Constructing a RunManager.
99
3) Executing the entropy workflow.
1010
4) Handling fatal errors with a non-zero exit code.
11-
12-
All scientific computation and I/O orchestration lives in RunManager and the
13-
workflow components it coordinates.
1411
"""
1512

1613
from __future__ import annotations
1714

1815
import logging
1916

20-
from CodeEntropy.config.run import RunManager
17+
from CodeEntropy.config.runtime import RunManager
2118

2219
logger = logging.getLogger(__name__)
2320

2421

2522
def main() -> None:
2623
"""Run the entropy workflow.
2724
28-
Main function for calculating the entropy of a system using the multiscale cell
29-
correlation method.
30-
31-
This function is the CLI entry point. It creates the output/job folder, then
32-
delegates to :class:`~CodeEntropy.config.run.RunManager` to execute the full
33-
workflow.
34-
3525
Raises:
3626
SystemExit: Exits with status code 1 on any unhandled exception.
3727
"""
@@ -45,7 +35,3 @@ def main() -> None:
4535
"Fatal error during entropy calculation: %s", exc, exc_info=True
4636
)
4737
raise SystemExit(1) from exc
48-
49-
50-
if __name__ == "__main__":
51-
main() # pragma: no cover
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@
3232
from rich.table import Table
3333
from rich.text import Text
3434

35-
from CodeEntropy.config.arg_config_manager import ConfigManager
36-
from CodeEntropy.config.data_logger import DataLogger
37-
from CodeEntropy.config.logging_config import LoggingConfig
38-
from CodeEntropy.entropy.entropy_manager import EntropyManager
39-
from CodeEntropy.group_molecules.group_molecules import GroupMolecules
40-
from CodeEntropy.levels.dihedral_tools import DihedralAnalysis
41-
from CodeEntropy.levels.mda_universe_operations import UniverseOperations
35+
from CodeEntropy.config.argparse import ConfigManager
36+
from CodeEntropy.core.logging import LoggingConfig
37+
from CodeEntropy.entropy.manager import EntropyManager
38+
from CodeEntropy.levels.dihedrals import DihedralAnalysis
39+
from CodeEntropy.levels.mda import UniverseOperations
40+
from CodeEntropy.molecules.grouping import GroupMolecules
41+
from CodeEntropy.results.reporter import DataLogger
4242

4343
logger = logging.getLogger(__name__)
4444
console = LoggingConfig.get_console()

‎CodeEntropy/core/__init__.py‎

Whitespace-only changes.

‎CodeEntropy/entropy/__init__.py‎

Whitespace-only changes.
File renamed without changes.
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@
1919

2020
import networkx as nx
2121

22-
from CodeEntropy.entropy.nodes.aggregate_entropy_node import AggregateEntropyNode
23-
from CodeEntropy.entropy.nodes.configurational_entropy_node import (
24-
ConfigurationalEntropyNode,
25-
)
26-
from CodeEntropy.entropy.nodes.vibrational_entropy_node import VibrationalEntropyNode
22+
from CodeEntropy.entropy.nodes.aggregate import AggregateEntropyNode
23+
from CodeEntropy.entropy.nodes.configurational import ConfigurationalEntropyNode
24+
from CodeEntropy.entropy.nodes.vibrational import VibrationalEntropyNode
2725

2826
logger = logging.getLogger(__name__)
2927

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323

2424
import pandas as pd
2525

26-
from CodeEntropy.config.logging_config import LoggingConfig
27-
from CodeEntropy.entropy.entropy_graph import EntropyGraph
28-
from CodeEntropy.entropy.water_entropy import WaterEntropy
29-
from CodeEntropy.levels.hierarchy_graph import LevelDAG
30-
from CodeEntropy.levels.level_hierarchy import LevelHierarchy
26+
from CodeEntropy.core.logging import LoggingConfig
27+
from CodeEntropy.entropy.graph import EntropyGraph
28+
from CodeEntropy.entropy.water import WaterEntropy
29+
from CodeEntropy.levels.hierarchy import LevelHierarchy
30+
from CodeEntropy.levels.level_dag import LevelDAG
3131

3232
logger = logging.getLogger(__name__)
3333
console = LoggingConfig.get_console()

0 commit comments

Comments
 (0)