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

Change behavior for adding Difference Metrics #36

Open
flo-schu opened this issue Jun 13, 2023 · 2 comments · May be fixed by #102
Open

Change behavior for adding Difference Metrics #36

flo-schu opened this issue Jun 13, 2023 · 2 comments · May be fixed by #102

Comments

@flo-schu
Copy link
Collaborator

flo-schu commented Jun 13, 2023

  • needs to subclass DifferenceBase
  • implement _evaluate function that calculates the metric
  • change metric input to class instead of string

from

comparator.add_difference_metric(
    'PeakHeight', reference, 'outlet.outlet',
)

to

from CADETProcess.comparison.difference import PeakHeight
comparator.add_difference_metric(
    PeakHeight, reference, 'outlet.outlet',
)

to create own metric

from CADETProcess.comparison.difference import DifferenceBase

class MyMetric(DifferenceBase):
    def _evaluate(self, ...)
        ...

comparator.add_difference_metric(
    MyMetric, reference, 'outlet.outlet',
)
@schmoelder
Copy link
Contributor

schmoelder commented Jun 13, 2023

I think, we should also instantiate the Metrics before adding them. This way, they can be modified on scripting level.

from CADETProcess.comparison.difference import PeakHeight
metric = PeakHeight()

# configure metric ...

comparator.add_difference_metric(
    metric, reference, 'outlet.outlet',
)

or

comparator.add_difference_metric(
    MyMetric(), reference, 'outlet.outlet',
)

@flo-schu flo-schu self-assigned this Jun 13, 2023
@flo-schu flo-schu removed their assignment Jun 27, 2023
@ronald-jaepel ronald-jaepel changed the title add section on how to implement your own difference metric Change behavior for adding Difference Metrics Jan 9, 2024
@ronald-jaepel
Copy link
Collaborator

Reminder of other ToDos:

  • general status of testing references/difference metrics
  • reference_single vs reference (is reference_single still required?)
  • what about component systems with sub-species?

@schmoelder schmoelder mentioned this issue Jan 10, 2024
11 tasks
@schmoelder schmoelder linked a pull request Jan 10, 2024 that will close this issue
11 tasks
@schmoelder schmoelder removed a link to a pull request Mar 2, 2024
11 tasks
@schmoelder schmoelder linked a pull request Mar 2, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants