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 matrix CI Tests on multiple Python versions and OS versions #353

Merged
merged 12 commits into from
Nov 13, 2023

Conversation

freemansw1
Copy link
Member

This PR adds matrix testing (a matrix of Linux, MacOS, Windows for Pythons 3.8, 3.9, 3.10, 3.11). Right now, this is configured to run on the primary tobac repo (i.e., this one) only, and not on fork repos to save computation time.

Note that this has indicated a bug/issue in testing with int32 vs int64 datatypes on Windows. I have a windows computer at home; I will have to debug there.

  • Have you followed our guidelines in CONTRIBUTING.md?
  • Have you self-reviewed your code and corrected any misspellings?
  • Have you written documentation that is easy to understand?
  • Have you written descriptive commit messages?
  • Have you added NumPy docstrings for newly added functions?
  • Have you formatted your code using black?
  • If you have introduced a new functionality, have you added adequate unit tests?
  • Have all tests passed in your local clone?
  • If you have introduced a new functionality, have you added an example notebook?
  • Have you kept your pull request small and limited so that it is easy to review?
  • Have the newest changes from this branch been merged?

@freemansw1 freemansw1 added the enhancement Addition of new features, or improved functionality of existing features label Oct 10, 2023
@freemansw1 freemansw1 added this to the Version 1.5.2 milestone Oct 10, 2023
@codecov
Copy link

codecov bot commented Oct 10, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5f096e3) 56.68% compared to head (b7739d5) 56.70%.

Additional details and impacted files
@@              Coverage Diff              @@
##           RC_v1.5.x     #353      +/-   ##
=============================================
+ Coverage      56.68%   56.70%   +0.02%     
=============================================
  Files             19       19              
  Lines           3426     3428       +2     
=============================================
+ Hits            1942     1944       +2     
  Misses          1484     1484              
Flag Coverage Δ
unittests 56.70% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
tobac/testing.py 95.55% <100.00%> (ø)
tobac/utils/general.py 71.14% <100.00%> (+0.19%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@w-k-jones w-k-jones left a comment

Choose a reason for hiding this comment

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

Very nice addition! Hopefully the fix for windows should be quite straightforward

@w-k-jones w-k-jones added the workflow Improvements and updates to the repository and CI label Oct 10, 2023
Copy link
Member

@JuliaKukulies JuliaKukulies left a comment

Choose a reason for hiding this comment

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

Nice, this is very useful, @freemansw1 ! Thanks for adding this! And hopefully it will not be to hard to fix the windows issue.

@freemansw1
Copy link
Member Author

I fixed the Windows bugs through keeping data types constant. Happy to wait for a re-review to merge if you want another look at it @JuliaKukulies @w-k-jones

@w-k-jones
Copy link
Member

I'm happy to merge straight away, I don't think the fix requires a re-review as it looks like a pretty straightforward (and sensible) change

@w-k-jones
Copy link
Member

w-k-jones commented Oct 11, 2023

Actually, as a workflow change, should this be merged into RC_v1.5.x or main?

Edit: it has some changes from RC_v1.5.x included, so I think it's best to keep the merge target as is

@freemansw1
Copy link
Member Author

Looks like #293 broke windows compatibility... will need to look into this before merging.

@JuliaKukulies
Copy link
Member

Looks like #293 broke windows compatibility... will need to look into this before merging.

Could that also be related to the change of dtypes in the feature detection/segmentation dataframes? What was the actual problem before you set these to constant in utils.general.combine_feature_dataframes ? Is that a thing we should consider doing in all functions that somehow modify the pandas dataframes?

@JuliaKukulies JuliaKukulies mentioned this pull request Nov 8, 2023
8 tasks
@freemansw1
Copy link
Member Author

Looks like #293 broke windows compatibility... will need to look into this before merging.

Could that also be related to the change of dtypes in the feature detection/segmentation dataframes? What was the actual problem before you set these to constant in utils.general.combine_feature_dataframes ? Is that a thing we should consider doing in all functions that somehow modify the pandas dataframes?

At first glance on my windows machine, it's not a datatype issue... rather the dataframe comes up empty (now, is this itself a result of a data type issue? Perhaps). I will work to debug here.

@freemansw1
Copy link
Member Author

Looks like #293 broke windows compatibility... will need to look into this before merging.

Could that also be related to the change of dtypes in the feature detection/segmentation dataframes? What was the actual problem before you set these to constant in utils.general.combine_feature_dataframes ? Is that a thing we should consider doing in all functions that somehow modify the pandas dataframes?

At first glance on my windows machine, it's not a datatype issue... rather the dataframe comes up empty (now, is this itself a result of a data type issue? Perhaps). I will work to debug here.

On second thought, I'm going to strongly bet that this is a time issue. Ugh. Times are going to be the death of me.

@freemansw1
Copy link
Member Author

Okay, this was actually an amazing issue to fix. On Windows, the lines in the test dataset making that are:

t_points = (t - t_start).astype("timedelta64[ms]").astype(int) / 1000

result in a float output (with a real <1 value even!). When they are converted to xarray, xarray preserves the milliseconds contained in these values, but our Iris feature detection path does not use them, resulting in incompatible times. This was a neat issue to find actually! Anyway it's resolved now!

@JuliaKukulies
Copy link
Member

Great job @freemansw1! Do you want to go ahead and merge this?

@freemansw1 freemansw1 merged commit d639db3 into tobac-project:RC_v1.5.x Nov 13, 2023
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Addition of new features, or improved functionality of existing features workflow Improvements and updates to the repository and CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants