Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reuse core pydantic model #25

Merged
merged 2 commits into from
Aug 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading