Skip to content

Commit

Permalink
Reuse core pydantic model (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
eleftherioszisis authored Aug 4, 2024
1 parent a6d6dad commit fd4697e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 35 deletions.
1 change: 0 additions & 1 deletion doc/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@ API Documentation
blue_cwl.recipes
blue_cwl.statistics
blue_cwl.density_manipulation
blue_cwl.model
blue_cwl.variant
4 changes: 4 additions & 0 deletions src/blue_cwl/core/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ def to_dict(self, **kwargs) -> dict:
return self.model_dump(**kwargs)

def to_string(self, **kwargs) -> str:
"""Serialize the object to JSON."""
return self.to_json(**kwargs)

def to_json(self, **kwargs) -> str:
"""Serialize the object to JSON."""
return self.model_dump_json(**kwargs)

Expand Down
2 changes: 1 addition & 1 deletion src/blue_cwl/mmodel/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
from enum import Enum
from pathlib import Path

from blue_cwl.core.common import CustomBaseModel
from blue_cwl.mmodel.config import split_config
from blue_cwl.mmodel.staging import (
materialize_canonical_config,
materialize_placeholders_config,
)
from blue_cwl.model import CustomBaseModel
from blue_cwl.nexus import get_distribution_as_dict
from blue_cwl.staging import get_entry_id

Expand Down
32 changes: 0 additions & 32 deletions src/blue_cwl/model.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/blue_cwl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@

from blue_cwl.constants import DEFAULT_CIRCUIT_BUILD_PARAMETERS
from blue_cwl.core import cwl
from blue_cwl.core.common import CustomBaseModel
from blue_cwl.exceptions import CWLWorkflowError
from blue_cwl.model import CustomBaseModel
from blue_cwl.typing import StrOrPath

if TYPE_CHECKING:
Expand Down

0 comments on commit fd4697e

Please sign in to comment.