Skip to content

Run examples as part of test suite#301

Open
jonbiemond wants to merge 2 commits into
JWock82:mainfrom
jonbiemond:294-run-examples-in-tests
Open

Run examples as part of test suite#301
jonbiemond wants to merge 2 commits into
JWock82:mainfrom
jonbiemond:294-run-examples-in-tests

Conversation

@jonbiemond

Copy link
Copy Markdown
Contributor

Run all files in /Examples as a test.

Resolves #294

@jonbiemond

Copy link
Copy Markdown
Contributor Author

As mentioned in #294, I don't love that these add +2 minutes to the time it takes to run tests. One option is to skip them by default while still including them in CI.

@JWock82

JWock82 commented Dec 20, 2025

Copy link
Copy Markdown
Owner

I do accidentally break the examples from time to time when refactoring parts of pynite. It would be nice to have a warning that that has happened so I can update the examples too.

@jonbiemond

Copy link
Copy Markdown
Contributor Author

Awesome, I'll figure out why the test fails on older version of Python.

@JWock82

JWock82 commented Dec 20, 2025

Copy link
Copy Markdown
Owner

I’ve updated the required NumPy version. Pynite 2.0.3 now requires NumPy ≥ 2.4.0. Recent changes in NumPy’s array handling were causing issues in Visualization.py, which have now been addressed. Pynite is compatible with the latest NumPy release.

If compatibility issues arise with Python 3.10 or 3.11 due to NumPy 2.4.0, we may drop support for those Python versions in a future release.

@JWock82

JWock82 commented Dec 20, 2025

Copy link
Copy Markdown
Owner

I just verified from my testing logs that numpy 2.2.6 is the highest version of numpy supported by Python 3.10. I'll be dropping support for 3.10 in the next release. 3.11 will be the minimum going forward.

@jonbiemond jonbiemond force-pushed the 294-run-examples-in-tests branch 2 times, most recently from 3e0371e to 81ba99b Compare December 20, 2025 20:29
@jonbiemond

jonbiemond commented Dec 20, 2025

Copy link
Copy Markdown
Contributor Author

I'm struggling to figure out the error with the Shear Wall - Basic example. It works fine if I run it manually as a script. I updated the test to skip that file if the python version <= 3.11 as a workaround.

@jonbiemond jonbiemond force-pushed the 294-run-examples-in-tests branch from 81ba99b to d14aaa1 Compare March 29, 2026 06:39
@jonbiemond

Copy link
Copy Markdown
Contributor Author

Tests fail with the following error:

FAILED Testing/test_examples.py::test_examples[/home/runner/work/Pynite/Pynite/Examples/Moment Frame - Lateral Load.py]
TypeError: PhysMember.max_shear() got an unexpected keyword argument 'combo_name'. Did you mean 'combo_tags'?

This example is fixed in #311. Please merge PR 311 and rerun the tests to confirm it is resolved.

The Shear Wall - Basic file fails when run in pytest on Python 3.11 or
earlier.
@jonbiemond

Copy link
Copy Markdown
Contributor Author

There are a few examples that are still broken. A couple fixes are waiting in PRs #311 and #326. And one still needs to be fixed as reported in issue #324.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run examples as part of test suite

2 participants