-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
failing test from vcs added here (#234)
* failing test from vcs added here * ok test passes again * reverted for now * commented out test for @durack1
- Loading branch information
1 parent
1b51879
commit 3d614dd
Showing
4 changed files
with
47 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import unittest | ||
import numpy | ||
import cdms2 | ||
import MV2 | ||
|
||
class CDMSTestAxisMissing(unittest.TestCase): | ||
def testAxismissing(self): | ||
data = """ | ||
-999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. | ||
0.059503571833625334 | ||
0.059503571833625334 0.05664014775641405 0.05193557222118004 | ||
0.04777129850801233 0.0407139313814465 0.029382624830271705 | ||
0.018469399844287374 0.0162382275289592 0.02646680241827459 | ||
0.04792041732949079 0.0689138797030203 0.08167038620212037 | ||
0.09273558459066569 0.11266293431057901 0.13663018925347364 | ||
0.15229174546388072 0.15284435880966177 0.13423845476113883 | ||
0.09945904378274077 0.07032267160267985 0.05551039827020481 | ||
0.045537187647785464 0.040532491867244946 0.03577527125478327 | ||
-999. -999. -999. | ||
-0.058062458673116 -0.08764922509099882 -0.11697036914487152 | ||
-0.14836133615864944 -0.17956528904564023 -0.21109198032585794 | ||
-0.23846429237248942 -0.2598536549218765 -0.27795672866320387 | ||
-0.2939939095159731 -0.30541031366330024 -0.307643559333884 | ||
-0.30078421139811795 -0.2841339526883441 -0.26485737397202497 | ||
-0.24287299694779327 -0.22379014890999907 -0.20121548204699846 | ||
-0.1746486732156772 -0.14585019344118372 -0.12070675757803526 | ||
-0.0997891159111037 -0.08229393660994214 -0.06779720501287469 | ||
-0.057213385470859794 -0.04875768191096844 -0.0402377347189964 | ||
-0.030169328367807245 -0.017560662894847895 -0.006968922654137132 | ||
0.0009773980274431048 0.007054306637034288 0.010472286514133042 | ||
0.010702384151997032 0.009231553701801242 0.007544033101056543 | ||
0.004639797857203645 -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. | ||
-999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. | ||
-999. -999. -999. | ||
""".split() | ||
data = numpy.array(data, dtype=numpy.float) | ||
data = MV2.masked_less(data, -900) | ||
d2 = cdms2.createAxis(data) | ||
self.assertTrue(numpy.ma.allclose(data,d2[:])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3d614dd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@doutriaux1 is turning off tests a good idea?
3d614dd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@durack1 probably not
3d614dd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@durack1 you need to pass an array[] not a transient variable to createAxis. I will change the documentation.
3d614dd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dnadeau4 this seem like a silly issue, as a transient variable is an array type, just wrapped as an independent class. So if you issue a $transientArray.data or similar, then it would work. I think it'd be better to get the code to recognize the
cdms
object as a first class citizen and just deal with it3d614dd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did fix it and I broke vcs. The order of detection of this array is important. If you want to take a look at the code below and give me a work around through a PR, Charles and I will try it.
3d614dd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cdms/Lib/axis.py
Lines 1917 to 1943 in 3d614dd