-
Notifications
You must be signed in to change notification settings - Fork 4
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
Krill inversion component sketch #321
base: main
Are you sure you want to change the base?
Krill inversion component sketch #321
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…nversion_extension
for more information, see https://pre-commit.ci
from typing import Any, Callable, Dict, Literal, Union | ||
from numpy.typing import ArrayLike | ||
|
||
def mae( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be mad
? it's used below in prepare_optimization
# RETURNS: Dictionary with optimization parameters and minimizer | ||
return {"parameters": params, "minimizer": minim} | ||
|
||
def optimize_scattering_model( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be renamed to something like optimize_model_parameters
, since it is not the model that gets optimized, but the parameters.
pass | ||
|
||
|
||
class validate_pcdwba(BaseModel): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'll be more efficient to have build a validator that works with a model class - let's talk more about this when we meet, because I had some thought on existing scattering model packages and had a discussion on this with Sven some time in Dec.
from numpy.typing import ArrayLike | ||
|
||
|
||
def normalize_scattering_model_parameters( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can go into optimize.py
since the output of the optimizer is doing the "inversion" so can just be packaged there.
pass | ||
|
||
|
||
def invert_population( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This invert_population
and Sv_prediction_error
are not strictly part of the "inversion" but are derived computations. Let me read through the rest of doc and see where these might go.
from ...survey import Survey | ||
|
||
|
||
def inversion_pipeline( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way things are designed now are completely separate from the hake component, which is not what I envisioned. I think it is fine as an intermediate step, but ultimately a more modularized framework will be needed to make the package more useful as an open-source project, and also remove the need for most "patcher" type of functions. Let's talk more about this when we meet.
Creating this so that it is easier to comment on code/pseudocode.