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

Move generic stuff into a new submodule #109

Merged
merged 72 commits into from
Dec 5, 2023
Merged

Move generic stuff into a new submodule #109

merged 72 commits into from
Dec 5, 2023

Conversation

liamhuber
Copy link
Member

This doesn't get all the way to releasing a new pyiron_snippets package, but it's a first step.

I moved my pyiron_base imports (including their git history) into a local submodule, along with the base test case class that helps with docs testing. Then I moved everything in pyiron_workflow.utils in there too. The code and tests for these generic things (which depend only on the standard library) are thus encapsulated in two directories and ready to be shipped off to their own repo. In the meantime, this also lets me remove my dependency on pyiron_base.

liamhuber and others added 30 commits March 23, 2021 14:14
* Draft a test class parent

* Only create and remove once, and apply to generic jobs

* Save name and path separately, and no magic strings

* Apply new class in DataContainer tests

* HDF removal should be redundant with project removal

* Hail Codacy, we who are about to die salute you

* More Codacy nits

* Because of course there's more

* Check for Codacy P=~P demand

* Srsly

* How I like it because Codacy can go to hell
* Use test class filepath instead of parent class filepath

* Test that the location of the actual test suites is caught

* Windows filepath separators
This module inherits from `unittest.TestCase` and is customized to automatically perform some additional generic checks (for now testing docstrings provided the module to test is specified)
Co-authored-by: Liam Huber <liam.huber@gmail.com>
Co-authored-by: Liam Huber <liam.huber@gmail.com>
Co-authored-by: Liam Huber <liam.huber@gmail.com>
Abstract class with a project with jobs and sub-projects
Abstract class with a project with jobs and sub-projects
# Conflicts:
#	pyiron_base/_tests.py
Co-authored-by: Liam Huber <liam.huber@gmail.com>
Co-authored-by: Liam Huber <liam.huber@gmail.com>
Co-authored-by: Liam Huber <liam.huber@gmail.com>
Co-authored-by: Liam Huber <liam.huber@gmail.com>
Co-authored-by: Liam Huber <liam.huber@gmail.com>
jan-janssen and others added 21 commits July 25, 2022 20:49
* Always reset the configuration to how you found it

* Add super calls

Children of `PyironTestCase` that define `setUpClass` without the super call now run into trouble at teardown because the attribute doesn't exist. This will almost certainly be an issue in downstream repos too, in other places where super is never called

* Remove unnecessary state update

* Clean up empty directory

* Manually remove HDF content not caught in project cleanup

* Clean up the orphaned job HDF

* Clean up project import/export tests
Add numpy equality check for unit tests
* Black line length

* Add tests for loading and inspecting

* Introduce and test helper classes for loading and inspecting

* Don't deprecate the conversion argument

It gets used in iter methods in a reasonable way

* Use just inspect or load if conversion is not a variable

* Format black

* Update pyiron_base/project/generic.py

Co-authored-by: Marvin Poul <poul@mpie.de>

* Break test into subtests

* Directly check getattr, as suggested by @pmrv

* Move loader classes to their own module, per @jan-janssen's suggestion

* Use full import path

* Move tests to their own test module

* Break sub tests into separate tests

* PEP8

* Also work without a database, per @jan-janssen's concern

* Make sure loader values are always synced with project values

The project knows how to stay up-to-date with the state; instead of re-inventing this security, let's just directly use the project attributes.

* Store and restore all the settings

Let's see if this recovers the `project_path` configuration setting that the projectpath tests seem to be relying on

* Format black

* Add logging to try and debug remote ci

* Remove sibling tests

* Add path to debug print

* More logging

* More logging

* Log more about the loader project

* Add filters progressively in logging

* Log the filetable path

* Log the actual folder contents

* Narrow the search

* Just look at length and look before turning off the database too

* Log the actual recursion check results

* Revert changes, the problem is upstream in FileTable still

I don't see trouble on my local machine because I don't specify TOP_LEVEL_DIRS in my config but the CI does.

* Resolve some codacy nits

* Update class descriptions

* Test sub-project loading

* Update tests to account for extra job in TestWithFilledProject

Making some effort to avoid magic numbers

---------

Co-authored-by: pyiron-runner <pyiron@mpie.de>
Co-authored-by: Marvin Poul <poul@mpie.de>
Copy link

github-actions bot commented Dec 5, 2023

Binder 👈 Launch a binder notebook on branch pyiron/pyiron_workflow/copy_base_content

@coveralls
Copy link

coveralls commented Dec 5, 2023

Pull Request Test Coverage Report for Build 7107728928

  • 130 of 146 (89.04%) changed or added relevant lines in 14 files are covered.
  • 57 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.04%) to 88.22%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pyiron_workflow/snippets/dotdict.py 10 13 76.92%
pyiron_workflow/snippets/logger.py 32 36 88.89%
pyiron_workflow/snippets/testcase.py 39 48 81.25%
Files with Coverage Reduction New Missed Lines %
io.py 11 90.71%
node.py 21 87.82%
composite.py 25 87.23%
Totals Coverage Status
Change from base Build 7094905260: 0.04%
Covered Lines: 3782
Relevant Lines: 4287

💛 - Coveralls

@liamhuber
Copy link
Member Author

This is also most of the weight for #46, since we already booted pyiron_atomistics into just the node library. Matplotlib is still left, but that's just a couple colour converter functions and should be easy to deal with in the new snippets.colors submodule.

@liamhuber liamhuber added the format_black trigger the Black formatting bot label Dec 5, 2023
Copy link

codacy-production bot commented Dec 5, 2023

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.27% (target: -1.00%) 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (3c1bde0) 2093 1714 81.89%
Head commit (1190847) 2186 (+93) 1796 (+82) 82.16% (+0.27%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#109) 12 12 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@liamhuber liamhuber merged commit b16c2f0 into main Dec 5, 2023
15 of 16 checks passed
@liamhuber liamhuber deleted the copy_base_content branch December 5, 2023 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
format_black trigger the Black formatting bot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants