-
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
Add unit tests for init
, transect_analysis
, and stratified_summary
Survey-class methods
#221
Add unit tests for init
, transect_analysis
, and stratified_summary
Survey-class methods
#221
Conversation
…into test-branch
…into test-branch
…into test-branch
Consolidate test and main branch
@leewujung: okay, so after futzing with the library versions, I believe I have squared away the issues I was running into regarding the test failures online (but passing locally). |
self.apportion_kriged_biomass( species_id ) | ||
# self.apportion_kriged_biomass( species_id ) |
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 guess this will be something that gets resolved once #215 is merged?
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.
Yep! The plan is to uncomment this once the kriging rework is completed re: #202.
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.
Hey @brandynlucca : The tests look great! I have only a couple embedded comments, and those below are applicable more generally so I put them in the overall comment here:
There are a few tests you could use the same approach for testing dtype and values separately like in this comment.
Just a note on what we discussed that rtol=1e-1 is a pretty big tolerance, which may signal that something is going on underneath that is not quite "equal", since the determination is based on the following:
For finite values, isclose uses the following equation to test whether two floating point values are equivalent.
absolute(a - b) <= (atol + rtol * absolute(b))
There are a few tests in which similar large rtol is used, like in test_stratified_transect_statistic
, so it'd be good to check what's going on.
Lastly, I think you could move the functions in utility_testing_functions.py
to conftest.py
as fixtures, so that they can be reused in the tests -- see Fixtures are reusable.
This PR includes new unit tests for the following
Survey
class methods and related functions:init
load_survey_data
validate_data_columns
andread_validated_data
functions nested within this methodbiometric_distributions
transect_analysis
fit_binned_length_weight_relationship
strata_sex_weight_proportions
strata_age_binned_weight_proportions
nasc_to_biomass_conversion
stratified_summary
Other
echopop.computation.operations
are used across multiple methodsgroup_merge
,meld
,stretch
) using both the current monkey-patched implementation as well as the future updated use as 'normal' functions (i.e.dataframe.method( args ) --> method( dataframe , args )
dictionary_shape_equal
) were added for testing equality in structures between nested dictionariesNaN
outputs