Before running any tests, you will need to have pytest
installed. You can install it by running
python3 -m pip install pytest testpath
on Linux and MacOS, or
pip install pytest testpath
on Windows.
The command
python3 -c "import oommfc; oommfc.test()"
will run a test suite to check that OOMMF is installed and accessible, and carry out additional tests of oommfc
.
If all tests pass, the last line of the output would read something like:
========================= 118 passed in 130.98 seconds =========================
If no tests fail: congratulations - you have a working installlation and there is no need to run tests in other sections of this chapter.
(On Windows machines, please type python
, instead of python3
.)
There are several ways how we can test if our OOMMFC and OOMMF are installed correctly. To run the tests, pytest
should be installed. To install it, run:
python3 -m pip install pytest
or
pip install pytest
if you are using Windows machine.
python3 -c "import oommfc; oommfc.test_not_oommf()"
Note: On Windows machines, please type python
, instead of python3
.
oommfc
can find either OOMMF or Docker on the system, you can run the following commands in your Python kernel:import oommfc
oommfc.oommf.status()
The function status
returns a dictionary showing whether or not OOMMF and docker can be found on the host machine. For example. {"host": True, "docker": False} means that OOMMF can be found on the host machine, but Docker cannot. If both are False
, to diagnose the issue run:
oommfc.oommf.status(verbose=True)
import oommfc
oommfc.oommf.version(where="host")
or in Docker container
import oommfc
oommfc.oommf.version(where="docker")
oommfc
tests that require OOMMF, run:python3 -c "import oommfc; oommfc.test_oommf()"
Note: On Windows machines, please type python
, instead of python3
.
python3 -c "import oommfc; oommfc.test()"
Note: On Windows machines, please type python
, instead of python3
.