Skip to content

Commit

Permalink
Drop some old legacy stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhekhorn committed Oct 17, 2024
1 parent d392c17 commit e4b04e9
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 441 deletions.
3 changes: 3 additions & 0 deletions src/eko/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
"""Evolution Kernel Operators."""

from . import io, version
from .io.runcards import OperatorCard, TheoryCard
from .io.struct import EKO
from .runner import solve

__version__ = version.__version__

__all__ = [
"io",
"OperatorCard",
"TheoryCard",
"EKO",
"solve",
]
199 changes: 0 additions & 199 deletions src/eko/io/legacy.py

This file was deleted.

15 changes: 11 additions & 4 deletions src/eko/io/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from typing import Optional

import yaml
from packaging.version import parse

from .. import version as vmod
from ..interpolation import XGrid
Expand Down Expand Up @@ -59,9 +60,15 @@ def load(cls, path: os.PathLike):
loaded metadata
"""
path = pathlib.Path(path)
content = cls.from_dict(
yaml.safe_load(InternalPaths(path).metadata.read_text(encoding="utf-8"))
)
# read raw file first to catch version
raw = yaml.safe_load(InternalPaths(path).metadata.read_text(encoding="utf-8"))
version = parse(raw["version"])
if version.major == 0 and version.minor == 13:
raise NotImplementedError("TODO")
elif version.major == 0 and version.minor == 14:
raise NotImplementedError("TODO")
else:
content = cls.from_dict(raw)
content._path = path
return content

Expand All @@ -70,7 +77,7 @@ def update(self):
if self._path is None:
logger.info("Impossible to set metadata, no file attached.")
else:
with open(InternalPaths(self._path).metadata, "w") as fd:
with open(InternalPaths(self._path).metadata, "w", encoding="utf8") as fd:
yaml.safe_dump(self.raw, fd)

@property
Expand Down
37 changes: 2 additions & 35 deletions src/eko/runner/__init__.py
Original file line number Diff line number Diff line change
@@ -1,39 +1,6 @@
"""Manage steps to DGLAP solution, and operator creation."""

from pathlib import Path
from typing import Union

from ..io.runcards import OperatorCard, TheoryCard
from ..io.types import RawCard
from . import legacy


# TODO: drop this altogether, replacing just with managed.solve
# it is currently kept not to break the interface, but the runcards upgrade and
# path conversion should be done by the caller, here we just clearly declare
# which types we expect
def solve(
theory_card: Union[RawCard, TheoryCard],
operators_card: Union[RawCard, OperatorCard],
path: Path,
):
r"""Solve DGLAP equations in terms of evolution kernel operators (EKO).
The EKO :math:`\mathbf E_{k,j}(a_s^1\leftarrow a_s^0)` is determined in order
to fullfill the following evolution
.. math::
\mathbf f(x_k,a_s^1) = \mathbf E_{k,j}(a_s^1\leftarrow a_s^0) \mathbf f(x_j,a_s^0)
The configuration is split between the theory settings, representing
Standard Model parameters and other defining features of the theory
calculation, and the operator settings, those that are more closely related
to the solution of the |DGLAP| equation itself, and determine the resulting
operator features.
from .managed import solve

Note
----
For further information about EKO inputs and output see :doc:`/code/IO`
"""
# TODO: drop this
legacy.Runner(theory_card, operators_card, path).compute()
__all__ = ["OperatorCard", "TheoryCard", "solve"]
100 changes: 0 additions & 100 deletions src/eko/runner/legacy.py

This file was deleted.

Loading

0 comments on commit e4b04e9

Please sign in to comment.