Comments (4)
fixed this by introducing a pytest fixture that changes the working directory after a test to what it was before. 494b3e8
from pyrates.
After further investigation I found that two backend tests where still affected by the change of directory: tests test_1_5_...
and test_1_6_...
create and change directories many times in a row, leading to somewhat recursive creation of sub-directories, because the numpy backend does not switch back to the original directory after one run. This leads to an error on Windows, because the maximum allowed length of a path is hit (as not indicated by the error message FileNotFoundError
). I added the line os.chdir(orig_dir)
at the end of the __init__
method of the numpy backend to prevent this. Now all tests are working both on Linux and Windows. Is this solution acceptable? Can the numpy backend also run without changing directories at all?
from pyrates.
This solution is acceptable. The NumpyBackend.compile
method changes the directory itself during the build process and always used os.chdir(orig_dir)
as a last step. Since I never used the frontend in isolation, I apparently forgot to account for the case that the __init__
of the NumpyBackend
is called, but not the compile
method. Which I suppose causes the problems on Windows.
Theoretically, we could also change the numpy backend to not change directories at all. However, this would require to create build paths with init files along the way, such that they are recognized as proper python modules. In other words, more temporary files would be created.
from pyrates.
Ok, closing now. Diagnosis shows that some tests still exit with a changed working directory, but the pytest fixture in conftest.py
reverts to the original one. Btw., I also added a fixture that makes sure, tests are run in the tests/ folder and not in the parent folder (which travis CI does by default and which caused other problems.)
from pyrates.
Related Issues (20)
- Allow additional (modulating) source nodes in edges HOT 3
- Add variable setter method to CircuitIR HOT 1
- Add to_file/from_file methods HOT 4
- Removing parts of pyrates from sys.modules in the backend causes troubles in other parts of the pipeline HOT 3
- Improving user friendliness and stability of PyRates HOT 2
- Add possibility to CircuitTemplate.apply() method to change constants HOT 3
- Enable purely scalar network models by disabling vectorization HOT 2
- Implement logging
- Trouble reproducing Jansen-Rit model dynamics in current version HOT 8
- Unexpected behavior of a zero-weighted edge with delay HOT 6
- Inheriting from an operator more than once causes operator key errors HOT 1
- Remove unnecessary indexing operations and variable definitions from equation file HOT 1
- error running jansenrit.py (jrc.compile) on MacOS HOT 3
- issues when running the example codes HOT 2
- Continuous data generation HOT 3
- Rework delay-coupling implementations HOT 3
- is there an option to get an ouput of the non-state variable? HOT 2
- error while using delay DE HOT 4
- issue with time-varying edge variables when multiple nodes are used HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyrates.