-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
163 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# SPDX-FileCopyrightText: 2023 easyCore contributors <core@easyscience.software> | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# © 2021-2023 Contributors to the easyCore project <https://github.com/easyScience/easyCore | ||
|
||
from easyCore.Objects.ObjectClasses import BaseObj | ||
from easyCore.Objects.ObjectClasses import Parameter | ||
from typing import Any, List | ||
|
||
class AnalysisBase(BaseObj): | ||
""" | ||
This virtual class allows for the creation of technique-specific Analysis objects. | ||
""" | ||
def __init__(self, name: str, parameters: List[Parameter], *args, **kwargs): | ||
super(AnalysisBase, self).__init__(name, *args, **kwargs) | ||
self.parameters = parameters | ||
|
||
|
||
# required dunder methods | ||
def __str__(self): | ||
return f"Analysis: {self.name}" | ||
|
||
def __call__(self, *args: Any, **kwds: Any) -> Any: | ||
return super().__call__(*args, **kwds) | ||
|
||
def __copy__(self) -> 'AnalysisBase': | ||
raise NotImplementedError("Copy not implemented") | ||
#return super().__copy__() | ||
|
||
def __deepcopy__(self, memo: Any) -> 'AnalysisBase': | ||
raise NotImplementedError("Deepcopy not implemented") | ||
#return super().__deepcopy__(memo) | ||
|
||
def __eq__(self, other: Any) -> bool: | ||
raise NotImplementedError("Equality not implemented") | ||
#return super().__eq__(other) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# SPDX-FileCopyrightText: 2023 easyCore contributors <core@easyscience.software> | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# © 2021-2023 Contributors to the easyCore project <https://github.com/easyScience/easyCore | ||
|
||
from easyCore.Objects.ObjectClasses import BaseObj | ||
from easyCore.Objects.ObjectClasses import Parameter | ||
from typing import Any, List | ||
|
||
class ExperimentBase(BaseObj): | ||
""" | ||
This virtual class allows for the creation of technique-specific Experiment objects. | ||
""" | ||
def __init__(self, name: str, parameters: List[Parameter], *args, **kwargs): | ||
super(ExperimentBase, self).__init__(name, *args, **kwargs) | ||
self.parameters = parameters | ||
self.name = name | ||
|
||
# required dunder methods | ||
def __str__(self): | ||
return f"Experiment: {self.name}" | ||
|
||
def __call__(self, *args: Any, **kwds: Any) -> Any: | ||
return super().__call__(*args, **kwds) | ||
|
||
def __copy__(self) -> 'ExperimentBase': | ||
raise NotImplementedError("Copy not implemented") | ||
#return super().__copy__() | ||
|
||
def __deepcopy__(self, memo: Any) -> 'ExperimentBase': | ||
raise NotImplementedError("Deepcopy not implemented") | ||
#return super().__deepcopy__(memo) | ||
|
||
def __eq__(self, other: Any) -> bool: | ||
raise NotImplementedError("Equality not implemented") | ||
#return super().__eq__(other) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# SPDX-FileCopyrightText: 2023 easyCore contributors <core@easyscience.software> | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# © 2021-2023 Contributors to the easyCore project <https://github.com/easyScience/easyCore | ||
|
||
from easyCore.Objects.ObjectClasses import BaseObj | ||
from easyCore.Objects.ObjectClasses import Parameter | ||
from typing import List | ||
from easyCore.Objects.Job.Theory import TheoryBase | ||
from easyCore.Objects.Job.Experiment import ExperimentBase | ||
from easyCore.Objects.Job.Analysis import AnalysisBase | ||
|
||
|
||
class JobBase(BaseObj): | ||
""" | ||
This virtual class allows for the creation of technique-specific Job objects. | ||
""" | ||
def __init__(self, name: str, parameters: List[Parameter], *args, **kwargs): | ||
super(JobBase, self).__init__(name, *args, **kwargs) | ||
self.parameters = parameters | ||
self._theory = None | ||
self._experiment = None | ||
self._analysis = None | ||
|
||
""" | ||
JobBase consists of Theory, Experiment, Analysis virtual classes. | ||
""" | ||
def set_theory(self, theory: TheoryBase): | ||
# The implementation must include __copy__ and __deepcopy__ methods | ||
raise NotImplementedError("setTheory not implemented") | ||
|
||
def set_experiment(self, experiment: ExperimentBase): | ||
# We might not have an experiment but this should be dealt with in the specific implementation | ||
raise NotImplementedError("setExperiment not implemented") | ||
|
||
def set_analysis(self, analysis: AnalysisBase): | ||
raise NotImplementedError("setAnalysis not implemented") | ||
|
||
@property | ||
def theory(self): | ||
return self._theory | ||
|
||
@property | ||
def experiment(self): | ||
return self._experiment | ||
|
||
@property | ||
def analysis(self): | ||
return self._analysis | ||
|
||
def calculate_model(self, *args, **kwargs): | ||
raise NotImplementedError("calculateModel not implemented") | ||
|
||
def fit(self, *args, **kwargs): | ||
raise NotImplementedError("fit not implemented") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# SPDX-FileCopyrightText: 2023 easyCore contributors <core@easyscience.software> | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# © 2021-2023 Contributors to the easyCore project <https://github.com/easyScience/easyCore | ||
|
||
from easyCore.Objects.ObjectClasses import BaseObj | ||
from easyCore.Objects.ObjectClasses import Parameter | ||
from typing import Any, List | ||
|
||
class TheoryBase(BaseObj): | ||
""" | ||
This virtual class allows for the creation of technique-specific Theory objects. | ||
""" | ||
def __init__(self, name: str, parameters: List[Parameter], *args, **kwargs): | ||
super(TheoryBase, self).__init__(name, *args, **kwargs) | ||
self.parameters = parameters | ||
|
||
|
||
# required dunder methods | ||
def __str__(self): | ||
return f"Theory: {self.name}" | ||
|
||
def __call__(self, *args: Any, **kwds: Any) -> Any: | ||
return super().__call__(*args, **kwds) | ||
|
||
def __copy__(self) -> 'TheoryBase': | ||
raise NotImplementedError("Copy not implemented") | ||
#return super().__copy__() | ||
|
||
def __deepcopy__(self, memo: Any) -> 'TheoryBase': | ||
raise NotImplementedError("Deepcopy not implemented") | ||
#return super().__deepcopy__(memo) | ||
|
||
def __eq__(self, other: Any) -> bool: | ||
raise NotImplementedError("Equality not implemented") | ||
#return super().__eq__(other) | ||
|
Empty file.