Skip to content

Commit

Permalink
Merge pull request #19 from Relifest/main
Browse files Browse the repository at this point in the history
Removed all_types, updated basic_types and extend_types.
  • Loading branch information
Relifest authored Aug 15, 2024
2 parents 733a9f2 + 9f1092c commit 35e5afc
Show file tree
Hide file tree
Showing 8 changed files with 1,269 additions and 2,594 deletions.
4 changes: 3 additions & 1 deletion pytdml/io/tdml_writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
# ------------------------------------------------------------------------------
import json
from typing import Union

from pytdml.io import read_from_json
from pytdml.type import TrainingDataset, EOTrainingDataset


Expand All @@ -40,4 +42,4 @@ def write_to_json(td: TrainingDataset or EOTrainingDataset, file_path: str, inde
"""
with open(file_path, "w", encoding='utf-8') as f:
json.dump(td.to_dict(), f, indent=indent, ensure_ascii=False)
# json.dump(remove_empty(td.dict()), f, indent=indent, ensure_ascii=False)
# json.dump(remove_empty(td.dict()), f, indent=indent, ensure_ascii=False)
26 changes: 13 additions & 13 deletions pytdml/type/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@
# SOFTWARE.
#
# ------------------------------------------------------------------------------
from .all_types import BaseCamelModel
from .all_types import KeyValuePair
from .all_types import MD_ScopeDescription
from .all_types import MD_Band
from .all_types import MD_Scope
from .all_types import CI_Date
from .all_types import MD_BrowseGraphic
from .all_types import CI_Citation
from .all_types import MD_Identifier
from .all_types import QualityElement
from .all_types import DataQuality
from .all_types import TrainingDataset
from .all_types import EOTrainingDataset
from .basic_types import BaseCamelModel
from .basic_types import KeyValuePair
from .basic_types import MD_ScopeDescription
from .basic_types import MD_Band
from .basic_types import MD_Scope
from .basic_types import CI_Date
from .basic_types import MD_BrowseGraphic
from .basic_types import CI_Citation
from .basic_types import MD_Identifier
from .basic_types import QualityElement
from .basic_types import DataQuality
from .basic_types import TrainingDataset
from .extended_types import EOTrainingDataset
8 changes: 4 additions & 4 deletions pytdml/type/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,31 +169,31 @@ def _validate_image_format(image_format: str):
if image_format in image_format_list:
return image_format
else:
pass
return None


def _valid_methods(labeling_methods: str):
labeling_methods_list = ["manual", "automatic", "semi-automatic", "unknown"]
if labeling_methods in labeling_methods_list:
return labeling_methods
else:
pass
return None


def _validate_training_type(training_type: str):
training_type_list = ["training", "validation", "test", "retraining"]
if training_type in training_type_list:
return training_type
else:
pass
return None


def _validate_evaluation_method_type(evaluation_method_type: str):
evaluation_method_type_list = ["directInternal", "directExternal", "indirect"]
if evaluation_method_type in evaluation_method_type_list:
return evaluation_method_type
else:
pass
return None


def to_camel(string: str) -> str:
Expand Down
Loading

0 comments on commit 35e5afc

Please sign in to comment.