Skip to content

Commit 8e4479a

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 <[email protected]>
1 parent a3f3d2d commit 8e4479a

File tree

31 files changed

+79
-66
lines changed

31 files changed

+79
-66
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,4 +292,4 @@ def getAttributes(self) -> list[str]:
292292
293293
:return: list of names as strings
294294
"""
295-
return list(self.contents)
295+
return list(self.contents)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""ClassAd utilities for DIRACCommon"""
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/ClassAd/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ def fixJDL(jdl: str) -> str:
3030
# Fix the possible lack of the brackets in the JDL
3131
if jdl.strip()[0].find("[") != 0:
3232
jdl = "[" + jdl + "]"
33-
return jdl
33+
return jdl
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""DIRACCommon WorkloadManagementSystem DB utilities"""

0 commit comments

Comments
 (0)