Skip to content

Commit

Permalink
♻️🩹 Renamed overwrite_{model|global}_dimension to force_{model|global…
Browse files Browse the repository at this point in the history
…}_dimension

So they won't conflict with the method which has the same name
  • Loading branch information
s-weigand committed Mar 10, 2022
1 parent 6f9ea57 commit 100e757
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions glotaran/model/dataset_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ def has_global_megacomplexes(self) -> bool:

def get_model_dimension(self) -> str:
"""Returns the dataset model's model dimension."""
if self.overwrite_model_dimension is not None:
return self.overwrite_model_dimension
if self.force_model_dimension is not None:
return self.force_model_dimension
if not hasattr(self, "_model_dimension"):
if not self.has_megacomplexes():
raise ValueError(f"No megacomplex set for dataset model '{self.label}'")
Expand Down Expand Up @@ -106,8 +106,8 @@ def overwrite_model_dimension(self, model_dimension: str) -> None:
# e.g. in FLIM, x, y dimension may get 'flattened' to a MultiIndex 'pixel'
def get_global_dimension(self) -> str:
"""Returns the dataset model's global dimension."""
if self.overwrite_global_dimension is not None:
return self.overwrite_global_dimension
if self.force_global_dimension is not None:
return self.force_global_dimension
if not hasattr(self, "_global_dimension"):
if self.has_global_model():
if isinstance(self.global_megacomplex[0], str):
Expand Down
4 changes: 2 additions & 2 deletions glotaran/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@

default_dataset_properties = {
"clp_guidance": {"type": str, "allow_none": True},
"overwrite_model_dimension": {"type": str, "allow_none": True},
"overwrite_global_dimension": {"type": str, "allow_none": True},
"force_model_dimension": {"type": str, "allow_none": True},
"force_global_dimension": {"type": str, "allow_none": True},
"group": {"type": str, "default": "default"},
"megacomplex": {"type": List[str], "allow_none": True},
"megacomplex_scale": {"type": List[Parameter], "allow_none": True},
Expand Down

0 comments on commit 100e757

Please sign in to comment.