Conversation
…s.png figure, changes to the wording in schematic.png figure, and a usage example (to complete once changes to the initialisation maps are completed.
… testing (rather than using an examples .json)
…mixing_dimensions', which should be 'vertical_mixing_variables' and 'vertical_mixing_dimensions'.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #37 +/- ##
===========================================
+ Coverage 15.43% 66.14% +50.70%
===========================================
Files 6 8 +2
Lines 473 700 +227
===========================================
+ Hits 73 463 +390
+ Misses 400 237 -163
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
erikvansebille
left a comment
There was a problem hiding this comment.
Great set of unit tests! See below some comments
| def test_advection_only(use_3D): | ||
| settings_file = 'tests/test_data/test_settings.json' | ||
| settings = pp.utils.load_settings(settings_file) | ||
| settings = pp.utils.download_plasticparcels_dataset('NEMO0083', settings, 'input_data') |
There was a problem hiding this comment.
Why is this call to download_plasticparcels_dataset needed, if the NEMO-data are not used? See also in the other examples
There was a problem hiding this comment.
In some of the test functions this can be removed, but in the cases where Stokes/Wind is used (and kernels = pp.constructors.create_kernel(...)), then the unbeaching kernel is included in that list. I'll remove this call to download_plasticparcels_dataset for the cases where the unbeaching kernel is not invoked.
There was a problem hiding this comment.
Actually, I've just realised, we use it in the make_standard_particleset call, which creates the particleset used to test the advection.
I thought this would be easier, since the particleset requires a number of variables used by the different kernels. So I can't remove this from each of the tests without writing a new function for particleset creation.
There was a problem hiding this comment.
Hmm, in the spirit of modularisation it may then be better to split it up into different functions at some point? Perhaps in a later PR?
There was a problem hiding this comment.
I agree, a class for PlasticParticle would be a cleaner approach, so that users can still use the parcels.ParticleSet.from_list() approach, with their own release locations.
Merge pull request #37 from OceanParcels/adding_new_tests
Broadening the unit tests
Merge pull request Parcels-code#37 from OceanParcels/adding_new_tests
This PR is to include unit tests for all of the functions in the constructors, and tests for all of the kernels.