-
Notifications
You must be signed in to change notification settings - Fork 32
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
Convert ramp fitting Cython .pyx files into annotated .py files #232
Closed
WilliamJamieson
wants to merge
31
commits into
spacetelescope:main
from
WilliamJamieson:feature/pyx_to_py
Closed
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
5f1c5ec
Refactor metadata computation for OLS CAS22 ramp
WilliamJamieson 8151490
Refactor jump detection pre-compute arrays
WilliamJamieson 0e7c51b
Update ramp fitting code to use .py file instead
WilliamJamieson 52e7e35
Update jump detection code to use .py file instead of .pyx
WilliamJamieson d9857af
Update setup.py to use .py file instead of .pyx
WilliamJamieson b582f22
Switch to all vectors
WilliamJamieson 32a8ee8
Resolve cython compiler warnings
WilliamJamieson 9d6a520
Simplify the ramp initializer
WilliamJamieson 9aa3d29
Fix annoying inline declarations
WilliamJamieson 515afa5
Refactor enum definitions and extract output fit's
WilliamJamieson 27437bc
Move parameter/variance allocation outside of cython
WilliamJamieson 01ba76e
Pre-allocate output and working memory arrays for
WilliamJamieson 37a310b
Move consistency checking outside of cython
WilliamJamieson df94f43
Remove kwarg from cython function
WilliamJamieson dc75dd8
Move code out of ramp and into other modules
WilliamJamieson 11891ba
Reorder jump so that most important methods are first
WilliamJamieson 5cb9689
Merge all cas22 modules together.
WilliamJamieson 02f8544
Reduce calls back to python
WilliamJamieson fbf662f
Clean up tests slightly
WilliamJamieson 6293bc2
bugfix for ramp tests.
WilliamJamieson 2281b7f
Partial revert of converting _fill_metadata to vectors
WilliamJamieson d62faa9
Move metadata creation out of cython completely
WilliamJamieson 59d4ed9
Update docs
WilliamJamieson 4aef566
Refactor jump detection into its own function
WilliamJamieson 618fa98
Remove dead files
WilliamJamieson 587fed7
Hide the cython module by making it private.
WilliamJamieson 2fc6832
Simplify the name of the wrapping module
WilliamJamieson 47693ed
Clean up imports
WilliamJamieson e09983a
Fix interface to match previous one
WilliamJamieson 9b29624
Bump cython version
WilliamJamieson 34e59dc
Update changes
WilliamJamieson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
""" | ||
This subpackage exists to hold the Cython implementation of the OLS cas22 algorithm | ||
This subpackage is private, and should not be imported directly by users. Instead, | ||
import from stcal.ramp_fitting.ols_cas22. | ||
""" | ||
from ._fit import FixedOffsets, Parameter, PixelOffsets, Variance, fit_ramps | ||
|
||
__all__ = [ | ||
"fit_ramps", | ||
"Parameter", | ||
"Variance", | ||
"PixelOffsets", | ||
"FixedOffsets", | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# cython: language_level=3str | ||
|
||
|
||
cpdef enum Parameter: | ||
intercept | ||
slope | ||
n_param | ||
|
||
|
||
cpdef enum Variance: | ||
read_var | ||
poisson_var | ||
total_var | ||
n_var | ||
|
||
|
||
cpdef enum: | ||
JUMP_DET = 4 | ||
|
||
|
||
cpdef enum FixedOffsets: | ||
t_bar_diff | ||
t_bar_diff_sqr | ||
read_recip | ||
var_slope_val | ||
n_fixed_offsets | ||
|
||
|
||
cpdef enum PixelOffsets: | ||
local_slope | ||
var_read_noise | ||
n_pixel_offsets |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Unfortunately, I was unable to eliminate this file because Cython's
enum
structures do not have a Python syntax equivalent at this time.