Skip to content

Conversation

@schmoelder
Copy link
Contributor

@schmoelder schmoelder commented Mar 2, 2024

This PR aims at restructuring the behavior for adding difference metrics to the Comparator class.

Closes #36

In practice, this could would then look something like

from CADETProcess.processModel import ComponentSystem
from CADETProcess.comparison import Comparator
from CADETProcess.comparison import AbsoluteArea
from tests.test_solution import TestSolutionIOGaussian

component_system = ComponentSystem(2)
tracer_peak = TestSolutionIOGaussian(component_system)

comparator = Comparator()

metric = AbsoluteArea(tracer_peak)
comparator.add_difference_metric(metric, 'outlet.outlet')

Note, it's not required any more to register the reference with the Comparator since this was only required for instantiating the difference metrics. This is now handled outside.

Since this would be a breaking change, I tried to add deprecation warnings s.t. we can provide backwards compatibility for some time.

To do

  • Discuss design changes with @ronald-jaepel
  • Add tests for Comparator
  • Make a plan for deprecating such interfaces
  • Update documentation

schmoelder and others added 30 commits January 24, 2024 09:52
- Fix caching
- Update Python versions
- Test on MacOS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change behavior for adding Difference Metrics

5 participants