Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
torogi94 committed Aug 22, 2023
1 parent f6d97c0 commit a6884d1
Show file tree
Hide file tree
Showing 7 changed files with 848 additions and 622 deletions.
4 changes: 2 additions & 2 deletions links/enzymeml.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ name = "EnzymeMLDocument.name"
doi = "EnzymeMLDocument.doi"

["citation.authors"]
last_name = "EnzymeMLDocument.creators.given_name"
first_name = "EnzymeMLDocument.creators.family_name"
last_name = "EnzymeMLDocument.creators.family_name"
first_name = "EnzymeMLDocument.creators.given_name"
email = "EnzymeMLDocument.creators.mail"

["citation.related_publications"]
Expand Down
24 changes: 24 additions & 0 deletions nmrpy/data_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,7 @@ def _phase_correct(cls, list_params):
phased_data = Fid._ps(
data, p0=mz.params["p0"].value, p1=mz.params["p1"].value
)
# data model
if abs(phased_data.min()) > abs(phased_data.max()):
phased_data *= -1
if sum(phased_data) < 0.0:
Expand Down Expand Up @@ -1405,6 +1406,19 @@ def __init__(self):
datetime_modified=_now,
)
del _now
self._force_pyenzyme = False

@property
def force_pyenzyme(self):
return self._force_pyenzyme

@force_pyenzyme.setter
def force_pyenzyme(self):
raise PermissionError("Forbidden!")

@force_pyenzyme.deleter
def force_pyenzyme(self):
raise PermissionError("Forbidden!")

@property
def data_model(self):
Expand Down Expand Up @@ -2243,6 +2257,16 @@ def save_to_file(self, filename=None, overwrite=False):

def save_data(self, file_format: str, filename=None, overwrite=False):
print("~~~ Method under contruction ~~~")
if self.force_pyenzyme:
import pyenzyme as pe

enzymeml = pe.EnzymeMLDocument(
name=self.data_mode.experiment.name
if hasattr(self.data_model.experiment, "name")
else "NMR experiment"
)
...
return 1
if file_format.lower() == ("enzymeml" or "nmrml"):
# model = self.data_model.convert_to(
# template=Path(__file__).parent.parent / "links/enzymeml.toml"
Expand Down
6 changes: 3 additions & 3 deletions nmrpy/datamodel/core/citation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
from sdRDM.base.listplus import ListPlus
from sdRDM.base.utils import forge_signature, IDGenerator

from typing import Any
from pydantic import AnyUrl
from typing import Any

from .term import Term
from .identifiertypes import IdentifierTypes
from .person import Person
from .publication import Publication
from .subjects import Subjects
from .publication import Publication
from .publicationtypes import PublicationTypes
from .identifiertypes import IdentifierTypes


@forge_signature
Expand Down
2 changes: 1 addition & 1 deletion nmrpy/datamodel/core/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@


from .fidarray import FIDArray
from .fid import FID
from .parameters import Parameters
from .fid import FID


@forge_signature
Expand Down
2 changes: 1 addition & 1 deletion nmrpy/datamodel/core/publication.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

from pydantic import AnyUrl

from .identifiertypes import IdentifierTypes
from .person import Person
from .publicationtypes import PublicationTypes
from .identifiertypes import IdentifierTypes


@forge_signature
Expand Down
Loading

0 comments on commit a6884d1

Please sign in to comment.