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
Transition post-processing pipeline infrastructure to the Hamilton library #387
Merged
Conversation
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
leroyvn
force-pushed
the
hamilton
branch
2 times, most recently
from
January 18, 2024 17:00
5abcec7
to
2ccd7c5
Compare
leroyvn
force-pushed
the
hamilton
branch
3 times, most recently
from
January 24, 2024 08:49
2da5eea
to
3052f69
Compare
leroyvn
force-pushed
the
hamilton
branch
8 times, most recently
from
March 1, 2024 11:13
a354683
to
b4d9e1c
Compare
leroyvn
force-pushed
the
hamilton
branch
3 times, most recently
from
March 1, 2024 15:34
ad3ca43
to
20acde2
Compare
This commit modifies the mode handling infrastructure in two ways: * It changes the mode registry value type from dict to Mode. This, in practice, has the modes() function return Mode instances instead of the keyword arguments used to generate them. * It adds the possibility to filter the output of the `modes()`, function typically using lambdas.
… WavelengthSet This commit adds several properties to the `BinSet` class. In particular, the `wavelengths` property returns the central wavelengths of all bins in the bin set and serves a purpose similar to `WavelengthSet.wavelengths`. For compatibility with the Hamilton framework, we also introduce a parent class for `BinSet` and `WavelengthSet`.
…ate bin selection tests This commit contains three changes: * The BinSet.arange() function is refactored to leverage vector calculus idioms and allow passing scalar values. * The MultiDeltaSpectrum class is fixed (bin selection routine had a bug and would raise if many wavelengths were passed), refactored (the `wavelengths` constructor argument is now required) and tested. * The tests for bin selection methods are relocated together with their parent class and refactored (there was a lot of fat to cut!).
The bin set generation logic was split based on argument type using single dispatch. This implementation was overly complex, given that we only need to handle xarray datasets and lists of them. The new implementation is much simpler and only addresses the most general case, wrapping datasets into a list if necessary.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Not ready for merge
This PR transitions our post-processing pipelines to the Hamilton library. This addresses the following issues we had:
Changes are as follows:
Mode
instances (allows to build filtered mode lists based on mode flags).mi_render()
function was fixed to solved an array-to-int conversion bug.DistantFluxMeasure
can now be instantiated with the factory aliasdistantflux
.BinSet
class's interface is extended with properties returning bin bounds and centres.BinSet
andWavelengthSet
classes now inherit from a common parent typeSpectralSet
. This is required to use these types in a Hamilton pipeline.spectral
subpackage got a testing makeover and underwent some refactoring to make it easier to maintain.MultiDeltaSpectrum
underwent refactoring and a testing makeover for improved maintainability.To do
Checklist
main
branch