Merged
Conversation
* Add abstract cube summary (SciTools#3987) Co-authored-by: stephen.worsley <stephen.worsley@metoffice.gov.uk> * add nox session conda list (SciTools#3990) * Added text to state the Python version used to build the docs. (SciTools#3989) * Added text to state the Python version used to build the docs. * Added footer template that includes the Python version used to build. * added new line * Review actions * added whatsnew * Iris py38 (SciTools#3976) * support for py38 * update CI and noxfile * enforce alphabetical xml element attribute order * full tests for py38 + fix docs-tests * add whatsnew entry * update doc-strings + review actions * Alternate xml handling routine (#29) * all xml tests pass for nox tests-3.8 * restored docstrings * move sort_xml_attrs * make sort_xml_attrs a classmethod * update sort_xml_attr doc-string Co-authored-by: Bill Little <bill.james.little@gmail.com> * add jamesp to whatsnew + minor tweak Co-authored-by: James Penn <james@jamespenn.co.uk> * normalise version to implicit development release number (SciTools#3991) * Gallery: update COP maps example (SciTools#3934) * update cop maps example * comment tweaks * minor comment tweak + whatsnew * reinstate whatsnew addition * remove duplicate whatsnew * don't support mpl v1.2 (SciTools#3941) * Cubesummary tidy (SciTools#3988) * Extra tests; fix for array attributes. * Docstring for CubeSummary, and remove some unused parts. * Fix section name capitalisation, in line with existing cube summary. * Handle array differences; quote strings in extras and if 'awkward'-printing. * Ensure scalar string coord 'content' prints on one line. * update intersphinx mapping and matplotlib urls (SciTools#4003) * update intersphinx mapping and matplotlib urls * use matplotlib intersphinx where possible * review actions * review actions * update readme badges (SciTools#4004) * update readme badges * pimp twitter badge * update readme logo img src and href (SciTools#4006) * update setuptools description (SciTools#4008) Co-authored-by: Patrick Peglar <patrick.peglar@metoffice.gov.uk> Co-authored-by: stephen.worsley <stephen.worsley@metoffice.gov.uk> Co-authored-by: tkknight <2108488+tkknight@users.noreply.github.com> Co-authored-by: James Penn <james@jamespenn.co.uk> Co-authored-by: Ruth Comer <ruth.comer@metoffice.gov.uk> Co-authored-by: Patrick Peglar <patrick.peglar@metoffice.gov.uk> Co-authored-by: stephen.worsley <stephen.worsley@metoffice.gov.uk> Co-authored-by: tkknight <2108488+tkknight@users.noreply.github.com> Co-authored-by: James Penn <james@jamespenn.co.uk> Co-authored-by: Ruth Comer <ruth.comer@metoffice.gov.uk>
* MeshMetadata class. * MeshMetadata extra members for dim names. * Comment for BaseMetadata refactoring.
* add mesh coordinate manager * wip * make shape methods private + reorganise method order * review actions * partial mesh * wip
* Update mesh-data-model branch (SciTools#4009) * Add abstract cube summary (SciTools#3987) Co-authored-by: stephen.worsley <stephen.worsley@metoffice.gov.uk> * add nox session conda list (SciTools#3990) * Added text to state the Python version used to build the docs. (SciTools#3989) * Added text to state the Python version used to build the docs. * Added footer template that includes the Python version used to build. * added new line * Review actions * added whatsnew * Iris py38 (SciTools#3976) * support for py38 * update CI and noxfile * enforce alphabetical xml element attribute order * full tests for py38 + fix docs-tests * add whatsnew entry * update doc-strings + review actions * Alternate xml handling routine (#29) * all xml tests pass for nox tests-3.8 * restored docstrings * move sort_xml_attrs * make sort_xml_attrs a classmethod * update sort_xml_attr doc-string Co-authored-by: Bill Little <bill.james.little@gmail.com> * add jamesp to whatsnew + minor tweak Co-authored-by: James Penn <james@jamespenn.co.uk> * normalise version to implicit development release number (SciTools#3991) * Gallery: update COP maps example (SciTools#3934) * update cop maps example * comment tweaks * minor comment tweak + whatsnew * reinstate whatsnew addition * remove duplicate whatsnew * don't support mpl v1.2 (SciTools#3941) * Cubesummary tidy (SciTools#3988) * Extra tests; fix for array attributes. * Docstring for CubeSummary, and remove some unused parts. * Fix section name capitalisation, in line with existing cube summary. * Handle array differences; quote strings in extras and if 'awkward'-printing. * Ensure scalar string coord 'content' prints on one line. * update intersphinx mapping and matplotlib urls (SciTools#4003) * update intersphinx mapping and matplotlib urls * use matplotlib intersphinx where possible * review actions * review actions * update readme badges (SciTools#4004) * update readme badges * pimp twitter badge * update readme logo img src and href (SciTools#4006) * update setuptools description (SciTools#4008) Co-authored-by: Patrick Peglar <patrick.peglar@metoffice.gov.uk> Co-authored-by: stephen.worsley <stephen.worsley@metoffice.gov.uk> Co-authored-by: tkknight <2108488+tkknight@users.noreply.github.com> Co-authored-by: James Penn <james@jamespenn.co.uk> Co-authored-by: Ruth Comer <ruth.comer@metoffice.gov.uk> * Master to mesh data model (SciTools#4022) * Add abstract cube summary (SciTools#3987) Co-authored-by: stephen.worsley <stephen.worsley@metoffice.gov.uk> * add nox session conda list (SciTools#3990) * Added text to state the Python version used to build the docs. (SciTools#3989) * Added text to state the Python version used to build the docs. * Added footer template that includes the Python version used to build. * added new line * Review actions * added whatsnew * Iris py38 (SciTools#3976) * support for py38 * update CI and noxfile * enforce alphabetical xml element attribute order * full tests for py38 + fix docs-tests * add whatsnew entry * update doc-strings + review actions * Alternate xml handling routine (#29) * all xml tests pass for nox tests-3.8 * restored docstrings * move sort_xml_attrs * make sort_xml_attrs a classmethod * update sort_xml_attr doc-string Co-authored-by: Bill Little <bill.james.little@gmail.com> * add jamesp to whatsnew + minor tweak Co-authored-by: James Penn <james@jamespenn.co.uk> * normalise version to implicit development release number (SciTools#3991) * Gallery: update COP maps example (SciTools#3934) * update cop maps example * comment tweaks * minor comment tweak + whatsnew * reinstate whatsnew addition * remove duplicate whatsnew * don't support mpl v1.2 (SciTools#3941) * Cubesummary tidy (SciTools#3988) * Extra tests; fix for array attributes. * Docstring for CubeSummary, and remove some unused parts. * Fix section name capitalisation, in line with existing cube summary. * Handle array differences; quote strings in extras and if 'awkward'-printing. * Ensure scalar string coord 'content' prints on one line. * update intersphinx mapping and matplotlib urls (SciTools#4003) * update intersphinx mapping and matplotlib urls * use matplotlib intersphinx where possible * review actions * review actions * update readme badges (SciTools#4004) * update readme badges * pimp twitter badge * update readme logo img src and href (SciTools#4006) * update setuptools description (SciTools#4008) * cirrus-ci compute credits (SciTools#4007) * update release process (SciTools#4010) * Stop using deprecated aliases of builtin types (SciTools#3997) * Stopped using deprecated aliases of builtin types. This is required to avoid warnings starting with NumPy 1.20.0. * Update lib/iris/tests/test_cell.py Co-authored-by: Bill Little <bill.little@metoffice.gov.uk> * Update lib/iris/tests/test_cell.py Co-authored-by: Bill Little <bill.little@metoffice.gov.uk> * Updated whatsnew. Co-authored-by: Bill Little <bill.little@metoffice.gov.uk> * celebrate first time iris contributors (SciTools#4013) * Docs unreleased banner (SciTools#3999) * baseline * removed debug comments * reverted * remove line * Testing * testing extensions * testing rtd_version * fixed if * removed line * tidy up * tidy comments * debug of pre-existing rtd variables * added reminder * testing * testing still * updated comments * added whatsnew * expanded the if conditiion * review actions * Update layout.html Remove alternative banner that used the RestructuredText notation. * review actions * drop __unicode__ method usage (SciTools#4018) * cirrus-ci conditional tasks (SciTools#4019) * cirrus-ci conditional tasks * use bc for bash arithmetic * revert back to sed * use expr * reword * minor documentation changes * review actions * make iris.common.metadata._hexdigest public (SciTools#4020) Co-authored-by: Patrick Peglar <patrick.peglar@metoffice.gov.uk> Co-authored-by: stephen.worsley <stephen.worsley@metoffice.gov.uk> Co-authored-by: tkknight <2108488+tkknight@users.noreply.github.com> Co-authored-by: James Penn <james@jamespenn.co.uk> Co-authored-by: Ruth Comer <ruth.comer@metoffice.gov.uk> Co-authored-by: Alexander Kuhn-Regnier <ahf.kuhnregnier@gmail.com> Co-authored-by: Patrick Peglar <patrick.peglar@metoffice.gov.uk> Co-authored-by: stephen.worsley <stephen.worsley@metoffice.gov.uk> Co-authored-by: tkknight <2108488+tkknight@users.noreply.github.com> Co-authored-by: James Penn <james@jamespenn.co.uk> Co-authored-by: Ruth Comer <ruth.comer@metoffice.gov.uk> Co-authored-by: Alexander Kuhn-Regnier <ahf.kuhnregnier@gmail.com>
* ConnectivityManager first pass. * ConnectivityManager align with proposed CoordManager. * Connectivity Manager review actions. * Connectivity Manager more review changes. * Use metadata_manager for Mesh location dimension. * Mesh dimension name abstraction. * Align Cooord and Connectivity Managers filters methods. * Completed Mesh class. * filter_cf improvements. * Moved filter_cf. * Mesh connectivity manager namedtuples comment. * Mesh removed trailing underscores. * Mesh _set_dimension_names improvements. * Mesh import rationalisation. * Mesh connectivity manager remove NDIM. * Connectivity manager use lazy indices_by_src(). * Connectivity manager clearer removal syntax. * Connectivity manager don't override __init__. * Connectivity manager correct base class syntax. * Metadata filter hexdigest reference fix. * test_MeshMetadata fix. * Rename filter to metadata_filter.
* minor fixes * wip
Contributor
Author
|
Something jazzy going on with the tests that I don't think can be related to my work. I'm trying running the whole suite locally to see what's up... |
… to play nicely with unittest.
bjlittle
requested changes
Feb 25, 2021
Member
bjlittle
left a comment
There was a problem hiding this comment.
@trexfeathers Great stuff!
Push the outcome of our offline conversation and I'll re-review again 👍
lib/iris/experimental/ugrid.py
Outdated
| node = edge = face = False | ||
| elif true_count == 0: | ||
| # Treat None as True in this case. | ||
| node, edge, face = [True if arg is None else arg for arg in args] |
Member
There was a problem hiding this comment.
@trexfeathers I kinda disagree with this change in behaviour.
What was there before was richer, where as what you're proposing now is quite restrictive and you're forcing the user to be explicit. Happy to chat about this to clarify.
This file contains hidden or 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
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.
🚀 Pull Request
Description
Adds a suite of tests for the
Meshclass.Test Style
In agreement with @bjlittle (and with tentative support from @pp-mo), these tests are written in a different style that is unit-esque, but focuses on being easier to write and read. You might call them "pragmatic tests" or some-such. The basic idea:
Cons
So an error takes more investigation.
But not much more, and errors always need some investigation anyway.
Pros
mock, which is known to be difficult.Plenty of stories of
mockmaking testing take longer than the functionality.I.e. more coverage for less thinking/writing.
With this style, I was able to write the
Meshtests - ~800 lines, ~80 tests, >100 assertions - pretty much fluidly without having to stop and work out how to write a test. This definitely hasn't been true in the past when trying to achieve proper unit test abstraction.The amount of time it takes to achieve good coverage with proper unit tests in my opinion often takes longer than the time they save when investigating errors.
This is of course only worth doing if it doesn't make the tests run excessively longer. For reference: testing the
Meshclass - a fairly rich class - with reasonably good coverage takes ~100ms locally for me.If this style causes problems / doesn't solve problems in the months ahead, I'm happy to roll back on this idea. And by all means object if you have other concerns!
Consult Iris pull request check list