Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

numpy 1.7.1 test failures with physicalField.py #381

Closed
wd15 opened this issue Sep 19, 2014 · 3 comments
Closed

numpy 1.7.1 test failures with physicalField.py #381

wd15 opened this issue Sep 19, 2014 · 3 comments

Comments

@wd15
Copy link
Contributor

wd15 commented Sep 19, 2014

Raymond Smith (see http://thread.gmane.org/gmane.comp.python.fipy/3024) noticed some failures with numpy 1.7.1. There is still the error associated with issue #375 and now this new issue.

======================================================================
FAIL: itemset (fipy.tools.dimensions.physicalField.PhysicalField)
Doctest: fipy.tools.dimensions.physicalField.PhysicalField.itemset
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/doctest.py", line 2201, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for fipy.tools.dimensions.physicalField.PhysicalField.itemset
  File "fipy/tools/dimensions/physicalField.py", line 577, in itemset

----------------------------------------------------------------------
File "fipy/tools/dimensions/physicalField.py", line 587, in fipy.tools.dimensions.physicalField.PhysicalField.itemset
Failed example:
a.itemset(PhysicalField("6 ft"))
Expected:
Traceback (most recent call last):
...
ValueError: can only place a scalar for an  array of size 1
Got:
Traceback (most recent call last):
File "/usr/lib/python2.7/doctest.py", line 1289, in __run
compileflags, 1) in test.globs
File "<doctest fipy.tools.dimensions.physicalField.PhysicalField.itemset[4]>", line 1, in <module>
a.itemset(PhysicalField("6 ft"))
File "fipy/tools/dimensions/physicalField.py", line 600, in itemset
self.value.itemset(value)
IndexError: index 3746994889972252674 is out of bounds for axis 0 with size 2

May just need to relax the failure requirement.

Imported from trac ticket #638, created by wd15 on 04-17-2013 at 11:05, last modified: 09-11-2013 at 17:03

@fipymigrate
Copy link

In 51a5eda:

#CommitTicketReference repository="fipy" revision="51a5edaed54c436d5f68ec9b936ba034899098a1"
Hack a fix for two possible different exceptions

Effectively convert the `IndexError` to a `ValueError`.

Is there a better way to catch different exceptions with doctest?

Addresses issue #381

Trac comment by Jonathan Guyer guyer@nist.gov on 09-05-2013 at 22:08

@guyer
Copy link
Member

guyer commented Sep 19, 2014

Pull request:


The following changes since commit 44bc4c5eee559d10c0811536ebd8a3c23f72364b:

  Merge branch 'develop' into ticket460-import-fipy-without-solvers-rebase (2013-09-05 16:35:41 -0400)

are available in the git repository at:


  ssh://git@code.matforge.org/nist/fipy.git ticket638-numpy_1_7_1_test_failures_with_physicalField_py

for you to fetch changes up to 51a5edaed54c436d5f68ec9b936ba034899098a1:

  Hack a fix for two possible different exceptions (2013-09-05 21:57:43 -0400)

----------------------------------------------------------------
Jonathan Guyer (1):
Hack a fix for two possible different exceptions

 fipy/tools/dimensions/physicalField.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Trac comment by guyer on 09-09-2013 at 11:14

@fipymigrate
Copy link

In 96d5155:

#CommitTicketReference repository="fipy" revision="96d515546badc84ae5849cc5015027382d2397ed"
Merge branch 'ticket638-numpy_1_7_1_test_failures_with_physicalField_py' into develop

Fixes issue #381

Trac comment by Daniel Wheeler daniel.wheeler2@gmail.com on 09-11-2013 at 17:03

@wd15 wd15 closed this as completed Sep 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants