Skip to content

Remove top level lib directory and move tests to top level#1108

Merged
tjtg merged 15 commits intometoppv:masterfrom
tjtg:delibify
Jan 14, 2020
Merged

Remove top level lib directory and move tests to top level#1108
tjtg merged 15 commits intometoppv:masterfrom
tjtg:delibify

Conversation

@tjtg
Copy link
Contributor

@tjtg tjtg commented Jan 13, 2020

Move the improver code directory and tests sub directory to the top level of the repository.
This better separates code and tests for installation, so that test code can be easily excluded if desired. Avoiding the top level lib directory also better follows python packaging conventions.

Test imports have been changed to relative imports in order to avoid "import tests" which is a very generic name and at risk of namespace conflicts. Relative imports also help keep the import name shorter, as some imports previously required backslash line continuations rather than being able to use brackets.
All imports have been automatically grouped and sorted into alphabetical order using the isort tool. I suggest that this tool is added to the Travis/Github test suite to keep import order consistent in the future. The isort tool runs on the whole repository within a few seconds.

Testing:

  • Ran tests and they passed OK

@tjtg tjtg requested review from TomekTrzeciak and arh89 January 13, 2020 16:30
tjtg added 3 commits January 13, 2020 16:31
This avoids improver code importing from tests.
Settings used: isort --recursive --atomic -w 79 -m 4 -y
Rename some duplicated directory/file names to make names shorter
@metoppv metoppv deleted a comment from benfitzpatrick Jan 13, 2020
arh89
arh89 previously approved these changes Jan 13, 2020
Copy link
Contributor

@arh89 arh89 left a comment

Choose a reason for hiding this comment

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

Thanks for doing this, @tjtg.

I've looked over the changes and they all look fine to me. For testing, I've checked that the unit tests and acceptance tests all run (and pass), and that the same number of tests are being picked up here as in master.

I've also created a suite PR with the necessary changes, and tested that these changes work for 1 cycle of UKV data.

@benfitzpatrick

This comment has been minimized.

Copy link
Contributor

@arh89 arh89 left a comment

Choose a reason for hiding this comment

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

I'm happy for this to be merged. Thanks very much.

(Note: there's a corresponding suite PR which will need to be merged at the same time)

@tjtg tjtg merged commit 2dd6195 into metoppv:master Jan 14, 2020
@tjtg tjtg deleted the delibify branch January 14, 2020 12:40
gavinevans added a commit to gavinevans/improver that referenced this pull request Jan 14, 2020
…or_apply_emos

* upstream/master:
  fix no error exit on wrong option (metoppv#1110)
  Remove top level lib directory and move tests to top level (metoppv#1108)
gavinevans added a commit to gavinevans/improver that referenced this pull request Jan 15, 2020
…_emos_documentation

* upstream/master:
  Refactoring of applying EMOS coefficients to support more robust variable naming (metoppv#1082)
  fix no error exit on wrong option (metoppv#1110)
  Remove top level lib directory and move tests to top level (metoppv#1108)
  Port all CLIs to Clize and eliminate ArgParser (metoppv#1101)
  Refactor cube manipulation (metoppv#1088)
  Replace usage of nccmp with internal netCDF comparison tool (metoppv#1089)
  Fix convert to realizations for realizations (metoppv#1097)
  Remove incorrect grid attributes (metoppv#1093)
  Removed filenames (metoppv#1086)
  Updated to remove useless object inheritance (metoppv#1087)
  IMPRO-1523: Convert optical flow to clize (metoppv#1053)
  IMPRO-1517: Update Orographic enhancement to use clize. (metoppv#1032)
MoseleyS added a commit that referenced this pull request Jan 16, 2020
* commit '2dd6195':
  Remove top level lib directory and move tests to top level (#1108)
MoseleyS pushed a commit to MoseleyS/improver that referenced this pull request Aug 22, 2024
)

* Move tests to top level

* Move improver to top level

* Update pytest test discovery path

* Bulk rewrite test imports

* Move tolerance constants to improver

This avoids improver code importing from tests.

* Convert test imports to relative

* Sort all imports

Settings used: isort --recursive --atomic -w 79 -m 4 -y

* Update bin scripts to remove lib directory

* Remove unused import

* Update paths in github actions

* Fix long line lengths

Rename some duplicated directory/file names to make names shorter

* Update docs makefile

* Fix import in metadata CLI

* Rename tests to improver_tests

* Update paths for change from tests to improver_tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants