clawpack/pyclaw

patch errors in nosetests

rjleveque opened this issue · 3 comments

@ketch, @mandli,

A user just pointed out that the nosetests in pyclaw are giving a bunch of errors like the one below. I get this with both Python2 and 3.

======================================================================
ERROR: pyclaw.examples.stegoton_1d.stegoton({'outdir': None, 'solver_type': 'classic'})
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/rjl/VENV/py3/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/Users/rjl/git/clawpack/clawpack/pyclaw/util.py", line 175, in <lambda>
    test = lambda: test_app(application, verifier, test_kwargs)
  File "/Users/rjl/git/clawpack/clawpack/pyclaw/util.py", line 240, in test_app
    claw.run()
  File "/Users/rjl/git/clawpack/clawpack/pyclaw/controller.py", line 354, in run
    self.output_options)
  File "/Users/rjl/git/clawpack/clawpack/pyclaw/solution.py", line 295, in write
    options=options,write_p=write_p)
  File "/Users/rjl/git/clawpack/clawpack/pyclaw/fileio/ascii.py", line 56, in write
    write_patch_header(q_file,state.patch)
  File "/Users/rjl/git/clawpack/clawpack/forestclaw/fileio/ascii.py", line 24, in write_patch_header
    f.write("%5i                  block_number\n" % patch.block_number)
AttributeError: 'Patch' object has no attribute 'block_number'

I have seen this a couple of times as well on brand new installations. I cannot seem to reproduce the problem myself and the tests pass on travis so I am a little uncertain as to what's causing it.

ketch commented

This happens if you run nosetests from clawpack/pyclaw. We don't do that, and it's a bad idea because of the weird directory structure. Like so many of our issues, this is the result of our refusing to commit to being a Python package or a collection of Fortran source code.

If you run nosetests from clawpack/pyclaw/src/pyclaw, things should be fine. I'll reopen this if you see a problem when doing that.

That would be why. Is there a way maybe to warn about that?