issues with tests and xml

164 views
Skip to first unread message

Marc Riera

unread,
Jun 1, 2018, 10:48:47 PM6/1/18
to ipi-users
Hello,

I installed (hopefully properly) i-pi, but when I run the command:
nosetests -v

Some of the tests are failing (output below). 
*********************************
(py27) [mrierari@russell i-pi]$ nosetests -v
Tests names of Atoms object. ... ERROR
Contraction with one bead. ... ok
Contraction with one bead. ... ok
Contraction with one bead. ... ok
Contraction with one bead. ... ok
Contraction with one bead. ... ok
Contraction with one bead. ... ok
Contraction with one bead. ... ok
Contraction with one bead. ... ok
Contraction with one bead. ... ok
Contraction with one bead. ... ok
Contraction with one bead. ... ok
Contraction with one bead. ... ok
Contraction with one bead. ... ok
Contraction with one bead. ... ok
Contraction with one bead. ... ok
Contraction with one bead. ... ok
Contraction with one bead. ... ok
Contraction with one bead. ... ok
Contraction with two beads. ... ok
Contraction with two beads. ... ok
Contraction with two beads. ... ok
Contraction with two beads. ... ok
Contraction with two beads. ... ok
Contraction with two beads. ... ok
Contraction with two beads. ... ok
Contraction with two beads. ... ok
Contraction with two beads. ... ok
Contraction with two beads. ... ok
Contraction with two beads. ... ok
Contraction with two beads. ... ok
Contraction with two beads. ... ok
Contraction with two beads. ... ok
Contraction with two beads. ... ok
Contraction with two beads. ... ok
Contraction with two beads. ... ok
Contraction with two beads. ... ok
Contraction with tree beads. ... ok
Contraction with tree beads. ... ok
Contraction with tree beads. ... ok
Contraction with tree beads. ... ok
Contraction with tree beads. ... ok
Contraction with tree beads. ... ok
Contraction with tree beads. ... ok
Contraction with tree beads. ... ok
Contraction with tree beads. ... ok
Contraction with tree beads. ... ok
Contraction with tree beads. ... ok
Contraction with tree beads. ... ok
Contraction with tree beads. ... ok
Contraction with tree beads. ... ok
Contraction with tree beads. ... ok
Contraction with tree beads. ... ok
Contraction with tree beads. ... ok
Contraction with tree beads. ... ok
Contraction with four beads. ... ok
Contraction with four beads. ... ok
Contraction with four beads. ... ok
Contraction with four beads. ... ok
Contraction with four beads. ... ok
Contraction with four beads. ... ok
Contraction with four beads. ... ok
Contraction with four beads. ... ok
Contraction with four beads. ... ok
Contraction with four beads. ... ok
Contraction with four beads. ... ok
Contraction with four beads. ... ok
Contraction with four beads. ... ok
Contraction with four beads. ... ok
Contraction with four beads. ... ok
Contraction with four beads. ... ok
Contraction with four beads. ... ok
Contraction with four beads. ... ok
Depend: Slicing test ... ok
Depend: Addition test ... ok
Depend: Increment test ... ok
Depend: Dot test ... ok
Depend: Dot-f test ... ok
Depend: read-only flag ... ok
Client: startup without socket. ... ok
Driver: startup without socket. ... ok
InterfaceSocket: startup. ... ok
Socket client for ASE. ... SKIP
Tests that xyz files are read correctly. ... ERROR
Tests that xyz files with multiple frames are read correctly. ... ERROR
Tests that pdb files are read correctly. ... FAIL
Tests that pdb files with multiple frames are read correctly. ... FAIL
Tests that pdb files are printed correctly. ... FAIL
Tests that xyz files are printed correctly. ... FAIL
Tests that mode/xyz files are read correctly. ... ERROR
Tests that mode/xyz files with multiple frames are read correctly. ... ERROR
Tests that mode/pdb files are read correctly. ... FAIL
Tests that mode/pdb files with multiple frames are read correctly. ... FAIL
Tests that mode/pdb files are printed correctly. ... FAIL
Tests that mode/xyz files are printed correctly. ... FAIL
ipi.tests.test_runs.test_lj_gas ... running ../../drivers/driver.x
ok
ipi.tests.test_units.test_case_insensitive ... ok
ipi_tests.engine.test_initializer.test_init_file ... ERROR
Failure: ImportError (No module named mock) ... ERROR
Failure: ImportError (No module named mock) ... ERROR
ipi_tests.utils.io.backends.test_io_units.test_process_units_noobj ... ERROR
ipi_tests.utils.io.backends.test_io_units.test_process_units_object ... ERROR
ipi_tests.utils.io.backends.test_io_xyz.test_read_xyz ... ERROR
ipi_tests.utils.io.backends.test_io_xyz.test_iter_xyz ... ERROR
ipi_tests.utils.io.backends.test_io_xyz.test_print_xyz ... ERROR
doc: run make aux ... ok
doc: run make ... 
********************************************

Also, and I guess that the above is one of the reasons, running 
i-pi input.xml 
for a slightly modified input.xml I took from : i-pi/examples/lammps/h2o-pimd
yields the error below
I realized that some other examples have the initialize insisde system, and they seem to load well with i-pi, but the manual (v1.0, page 52, section 5.1.2) states that initialize must be inside simulation.

**********************************
(py27) [mrierari@russell test]$ i-pi input.xml
Traceback (most recent call last):
  File "/home/mrierari/codes/i-pi/bin/i-pi", line 105, in <module>
    main(args[0], options)
  File "/home/mrierari/codes/i-pi/bin/i-pi", line 48, in main
    simulation = Simulation.load_from_xml(fn_input, request_banner=True, custom_verbosity=options.verbosity)
  File "/home/mrierari/codes/i-pi/ipi/engine/simulation.py", line 78, in load_from_xml
    input_simulation.parse(xmlrestart.fields[0][1])
  File "/home/mrierari/codes/i-pi/ipi/utils/inputvalue.py", line 342, in parse
    raise NameError("Tag name '" + f + "' is not a recognized property of '" + xml.name + "' objects")
NameError: Tag name 'initialize' is not a recognized property of 'simulation' objects
***********************************

******************** input.xml ***********
<simulation>
   <initialize nbeads='1'>
      <file mode='xyz' units='angstrom'> test.xyz </file>
      <cell mode='manual' units='angstrom'>
         [100.0,0.0,0.0,0.0,100.0,0.0,0.0,0.0,100.0]
      </cell>
      <velocities mode="thermal" units='kelvin'> 20 </velocities>
   </initialize>
   <output prefix='no_rpc'>
      <properties stride='1' filename='out'>  [ step, time{picosecond}, conserved, temperature{kelvin}, kinetic_cv, potential, pressure_cv{megapascal}] </properties>
      <trajectory filename='pos' stride='20'> positions </trajectory>
   </output>
   <total_steps>500000</total_steps>
   <prng><seed>32345</seed></prng>
   <forces>
      <socket mode='unix'>
         <address>localhost</address>
         <port> 31415 </port>
      </socket>
   </forces>
   <ensemble mode='nvt'>
      <thermostat mode='svr'>
         <tau units='femtosecond'>25</tau>
      </thermostat>
      <timestep units='femtosecond'> 0.25</timestep>
      <temperature units='kelvin'>298</temperature>
   </ensemble>
</simulation>
**********************************************************8

I am pretty sure is some error in my configuration, but sincerely I don't know where to look at.

I am using a conda environment for python 2.7, and I made sure that PYTHONPATH contains the path to the installed libraries:
(py27) [mrierari@russell test]$ echo $PYTHONPATH
/home/mrierari/codes/miniconda3/envs/py27/lib/python2.7/site-packages/:/home/mrierari/codes/i-pi:/home/mrierari/codes/miniconda3/envs/py27/

I would appreciate any hint on what am I doing wrong.

Thanks!

Marc

venkat kapil

unread,
Jun 2, 2018, 12:24:00 PM6/2/18
to ipi-users
1) Thanks for pointing them out. We have found the source of the failures and are working making them work. Just FYI these issues are harmless. 
2) Some of the examples are outdated and we should purge them. You can try h2o-pimd.1 which should work fine. 

Marc Riera

unread,
Jun 2, 2018, 12:26:59 PM6/2/18
to ipi-users
Thanks a lot!

Marc

CHAITANYA JITENDRA SHAH

unread,
Jun 17, 2023, 3:29:25 PM6/17/23
to ipi-users
Hello Venkat and Marc

I recently came to know about I-Pi and since it could be very useful in my project, I am trying to install it.

I am following the steps given in the manual. But after completion of the installation, when I run the command: nosetests -v,
I get lot of errors. Unlike Marc's case, I mostly get errors and only some of the tests turn out to be ok. 

Can you please help me in finding what is going wrong? I am very new to installations and stuff, so please be patient.

Here is the output I get:

Intermediate function to run the examples (by calling Runner_examples) which makes ... ERROR
Intermediate function to run the regression test (by calling Runner) and makes ... ERROR
This function recursively searches for test ... ERROR
This function recursively searches for test ... ERROR
This function looks for the existence of test_settings.dat file. ... ERROR
Modify xml to run dummy tests ... ERROR
Tests names of Atoms object. ... ok
ipi_tests.unit_tests.engine.test_initializer.test_init_file ... ERROR
ipi_tests.unit_tests.engine.test_properties.test_Trajectories_print_traj ... ERROR
Failure: ModuleNotFoundError (No module named 'pytest_mock') ... ERROR
ipi_tests.unit_tests.utils.io.backends.test_io_units.test_process_units_noobj ... ERROR
ipi_tests.unit_tests.utils.io.backends.test_io_units.test_process_units_object ... ERROR
ipi_tests.unit_tests.utils.io.backends.test_io_xyz.test_read_xyz ... ERROR
ipi_tests.unit_tests.utils.io.backends.test_io_xyz.test_iter_xyz ... ERROR
ipi_tests.unit_tests.utils.io.backends.test_io_xyz.test_print_xyz ... ERROR
Test contraction to `n` replicas with original positions `q`. ... ERROR

Depend: Slicing test ... ok
Depend: Addition test ... ok
Depend: Increment test ... ok
Depend: Dot test ... ok
Depend: Dot-f test ... ok
Depend: read-only flag ... ok
Tests that xyz files are read correctly. ... ok
Tests that xyz files with multiple frames are read correctly. ... ok
Tests that pdb files are read correctly. ... ok
Tests that pdb files with multiple frames are read correctly. ... ok
Tests that pdb files are printed correctly. ... ok
Tests that xyz files are printed correctly. ... ok
Tests that mode/xyz files are read correctly. ... ok
Tests that mode/xyz files with multiple frames are read correctly. ... ok
Tests that mode/pdb files are read correctly. ... ok
Tests that mode/pdb files with multiple frames are read correctly. ... ok
Tests that mode/pdb files are printed correctly. ... ok
Tests that mode/xyz files are printed correctly. ... ok
ipi_tests.unit_tests.utils.test_units.test_case_insensitive ... ok

======================================================================
ERROR: Intermediate function to run the examples (by calling Runner_examples) which makes
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/home/chaitanya/anaconda3/lib/python3.9/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
TypeError: test_example() missing 1 required positional argument: 'ex'

======================================================================
ERROR: Intermediate function to run the regression test (by calling Runner) and makes
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/home/chaitanya/anaconda3/lib/python3.9/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
TypeError: test_regtest() missing 1 required positional argument: 'regtest'

======================================================================
ERROR: This function recursively searches for test
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/home/chaitanya/anaconda3/lib/python3.9/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/chaitanya/anaconda3/lib/python3.9/site-packages/nose/util.py", line 620, in newfunc
    return func(*arg, **kw)
TypeError: get_test_list() missing 1 required positional argument: 'parent'

======================================================================
ERROR: This function recursively searches for test
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/home/chaitanya/anaconda3/lib/python3.9/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
TypeError: get_test_list() missing 1 required positional argument: 'parent'

======================================================================
ERROR: This function looks for the existence of test_settings.dat file.
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/home/chaitanya/anaconda3/lib/python3.9/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
TypeError: get_test_settings() missing 1 required positional argument: 'example_folder'

======================================================================
ERROR: Modify xml to run dummy tests
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/home/chaitanya/anaconda3/lib/python3.9/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
TypeError: modify_xml_4_dummy_test() missing 5 required positional arguments: 'input_name', 'output_name', 'nid', 'driver_info', and 'test_settings'

======================================================================
ERROR: ipi_tests.unit_tests.engine.test_initializer.test_init_file
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/home/chaitanya/anaconda3/lib/python3.9/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
TypeError: test_init_file() missing 1 required positional argument: 'create_xyz_sample_file'

======================================================================
ERROR: ipi_tests.unit_tests.engine.test_properties.test_Trajectories_print_traj
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/home/chaitanya/anaconda3/lib/python3.9/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
TypeError: test_Trajectories_print_traj() missing 2 required positional arguments: 'prepare_Trajectories_print_traj' and 'mocker'

======================================================================
ERROR: Failure: ModuleNotFoundError (No module named 'pytest_mock')
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/home/chaitanya/anaconda3/lib/python3.9/site-packages/nose/failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "/home/chaitanya/anaconda3/lib/python3.9/site-packages/nose/loader.py", line 416, in loadTestsFromName
    module = self.importer.importFromPath(
  File "/home/chaitanya/anaconda3/lib/python3.9/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/home/chaitanya/anaconda3/lib/python3.9/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/chaitanya/anaconda3/lib/python3.9/imp.py", line 234, in load_module
    return load_source(name, filename, file)
  File "/home/chaitanya/anaconda3/lib/python3.9/imp.py", line 171, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 711, in _load
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/home/chaitanya/i-pi/ipi_tests/unit_tests/utils/io/backends/test__init__.py", line 5, in <module>
    from pytest_mock import mocker
ModuleNotFoundError: No module named 'pytest_mock'

======================================================================
ERROR: ipi_tests.unit_tests.utils.io.backends.test_io_units.test_process_units_noobj
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/home/chaitanya/anaconda3/lib/python3.9/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
TypeError: test_process_units_noobj() missing 1 required positional argument: 'units_preparation'

======================================================================
ERROR: ipi_tests.unit_tests.utils.io.backends.test_io_units.test_process_units_object
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/home/chaitanya/anaconda3/lib/python3.9/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
TypeError: test_process_units_object() missing 1 required positional argument: 'units_preparation'

======================================================================
ERROR: ipi_tests.unit_tests.utils.io.backends.test_io_xyz.test_read_xyz
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/home/chaitanya/anaconda3/lib/python3.9/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
TypeError: test_read_xyz() missing 1 required positional argument: 'create_random_xyz_traj_to_read'

======================================================================
ERROR: ipi_tests.unit_tests.utils.io.backends.test_io_xyz.test_iter_xyz
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/home/chaitanya/anaconda3/lib/python3.9/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
TypeError: test_iter_xyz() missing 1 required positional argument: 'create_random_xyz_traj_to_read'

======================================================================
ERROR: ipi_tests.unit_tests.utils.io.backends.test_io_xyz.test_print_xyz
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/home/chaitanya/anaconda3/lib/python3.9/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
TypeError: test_print_xyz() missing 1 required positional argument: 'create_random_xyz_traj_to_write'

======================================================================
ERROR: Test contraction to `n` replicas with original positions `q`.
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/home/chaitanya/anaconda3/lib/python3.9/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
TypeError: test_contraction() missing 2 required positional arguments: 'n' and 'q'

----------------------------------------------------------------------
Ran 35 tests in 3.023s

FAILED (errors=15)


I hope you can help.

Thanks,
Chaitanya

On Saturday, 2 June 2018 at 21:56:59 UTC+5:30 marc.ri...@gmail.com wrote:
Thanks a lot!

Marc

Michele Ceriotti

unread,
Jun 17, 2023, 7:15:01 PM6/17/23
to ipi-users
Hi Chaitanya, 
      Actually the problem is that we don't use nosetests since forever, the manual is outdated there. 
You can run tests by running i-pi-tests from the root folder of i-PI. 
We'll have to update the docs. 
Best
Michele

CHAITANYA JITENDRA SHAH

unread,
Jun 18, 2023, 5:55:22 AM6/18/23
to ipi-users
Okay thanks for informing.

So if the sample examples are running, I am good to go?

Chaitanya

Reply all
Reply to author
Forward
0 new messages