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

Add new wrapper to Calculator that supports V2API and facets #1381

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

n-h-diaz
Copy link
Contributor

@n-h-diaz n-h-diaz commented Jun 6, 2024

This is just a first pass to get the basic functionality working.

I added a new wrapper because the existing wrapper (DerivedSeries) only reads from BT and doesn't support facets (which I think is by design, since I think the primary use case is to combine across imports) or ObsCollection

The new wrapper will only match facets and (like DerivedSeries) will only return one computed response. Since it uses V2API, it also supports ObsCollection without the need for child places.

There are some pending TODOs to clean this up as a follow up, particularly relating to how facets are handled. Going forward, I can further separate the two wrappers, which will avoid precomputing the facets:

  • Define separate callbacks for Calculation (don't reuse anything from DerivedSeries)
  • Define new type for Calcuation
  • Make chooseItem a callback to Calculator, so Calculation and DerivedSeries can handle candidates independently
    (This will simplify a lot of the logic in Calculation.computeCalculation)

@@ -101,13 +101,13 @@ func (c *calculator) statVars() []string {
return statVars
}

func (c *calculator) calculate(
func (c *Calculator) Calculate(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

calculate should still be an internal function of Calculator? For an interface perspective, the caller should not know the internals/pass the callbacks?

@shifucun
Copy link
Contributor

This PR can be closed? @n-h-diaz

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.

2 participants