Skip to content

Commit 184bc8d

Browse files
chrisburrclaude
andcommitted
refactor: restructure DIRACCommon to preserve DIRAC directory hierarchy
Reorganize DIRACCommon modules to match the original DIRAC structure: - Core/Utilities/ClassAd/ClassAdLight.py (utilities belong in Core) - WorkloadManagementSystem/DB/JobDBUtils.py (preserves original location) - WorkloadManagementSystem/Utilities/ParametricJob.py (preserves original location) Update all imports across DIRAC, diracx, and DIRACCommon to use the new structured paths. Reorganize tests to match the new directory structure. This maintains the logical organization while enabling proper code migration. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a3f3d2d commit 184bc8d

File tree

30 files changed

+29
-23
lines changed

30 files changed

+29
-23
lines changed

dirac-common/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ This package solves the circular dependency issue where DiracX needs DIRAC utili
88

99
## Contents
1010

11-
- `DIRACCommon.Utils.ReturnValues`: DIRAC's S_OK/S_ERROR return value system
12-
- `DIRACCommon.Utils.DErrno`: DIRAC error codes and utilities
11+
- `DIRACCommon.Core.Utilities.ReturnValues`: DIRAC's S_OK/S_ERROR return value system
12+
- `DIRACCommon.Core.Utilities.DErrno`: DIRAC error codes and utilities
13+
- `DIRACCommon.Core.Utilities.ClassAd.ClassAdLight`: JDL parsing utilities
14+
- `DIRACCommon.WorkloadManagementSystem.DB.JobDBUtils`: Job database utilities
15+
- `DIRACCommon.WorkloadManagementSystem.Utilities.ParametricJob`: Parametric job utilities
1316

1417
## Installation
1518

@@ -20,7 +23,7 @@ pip install DIRACCommon
2023
## Usage
2124

2225
```python
23-
from DIRACCommon.Utils.ReturnValues import S_OK, S_ERROR
26+
from DIRACCommon.Core.Utilities.ReturnValues import S_OK, S_ERROR
2427

2528
def my_function():
2629
if success:

dirac-common/src/DIRACCommon/Utils/ClassAd/ClassAdLight.py renamed to dirac-common/src/DIRACCommon/Core/Utilities/ClassAd/ClassAdLight.py

File renamed without changes.

dirac-common/src/DIRACCommon/Utils/ClassAd/__init__.py renamed to dirac-common/src/DIRACCommon/Core/Utilities/ClassAd/__init__.py

File renamed without changes.
File renamed without changes.

dirac-common/src/DIRACCommon/Utils/ReturnValues.py renamed to dirac-common/src/DIRACCommon/Core/Utilities/ReturnValues.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from typing import Any, Callable, cast, Generic, Literal, overload, Type, TypeVar, Union
1515
from typing_extensions import TypedDict, ParamSpec, NotRequired
1616

17-
from DIRACCommon.Utils.DErrno import strerror
17+
from DIRACCommon.Core.Utilities.DErrno import strerror
1818

1919

2020
T = TypeVar("T")
File renamed without changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""DIRACCommon Core utilities"""

dirac-common/src/DIRACCommon/Utils/JobDBUtils.py renamed to dirac-common/src/DIRACCommon/WorkloadManagementSystem/DB/JobDBUtils.py

File renamed without changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""DIRACCommon WorkloadManagementSystem DB utilities"""

dirac-common/src/DIRACCommon/Utils/ParametricJob.py renamed to dirac-common/src/DIRACCommon/WorkloadManagementSystem/Utilities/ParametricJob.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"""
77
import re
88

9-
from DIRACCommon.Utils.ClassAd.ClassAdLight import ClassAd
10-
from DIRACCommon.Utils.ReturnValues import S_OK, S_ERROR
11-
from DIRACCommon.Utils.DErrno import EWMSJDL
9+
from DIRACCommon.Core.Utilities.ClassAd.ClassAdLight import ClassAd
10+
from DIRACCommon.Core.Utilities.ReturnValues import S_OK, S_ERROR
11+
from DIRACCommon.Core.Utilities.DErrno import EWMSJDL
1212

1313

1414
def __getParameterSequence(nPar, parList=[], parStart=1, parStep=0, parFactor=1):

0 commit comments

Comments
 (0)