-
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.
* recreate cdms2 with libpng from conda-forge * force libpng=1.6.34 in circleci yml * fix #246 clone axis units issue * add test
- Loading branch information
1 parent
9bbf339
commit e4ea279
Showing
2 changed files
with
30 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from __future__ import print_function | ||
import unittest | ||
import os | ||
from subprocess import Popen, PIPE | ||
import shlex | ||
import MV2, cdms2 | ||
|
||
|
||
class TestAxis(unittest.TestCase): | ||
|
||
def testCloneUnits(self): | ||
|
||
tmp = MV2.ones(3, id='tmp') | ||
ax = tmp.getAxis(0) | ||
ax.standard_name = "time" | ||
ax.id = 'time' | ||
ax.units = "seconds since 1900-01-01T00:00:00Z" | ||
ax.long_name = "time in seconds (UT)" | ||
ax.time_origin = "01-JAN-1900 00:00:00" | ||
ax.designateTime() | ||
|
||
f = cdms2.open('tmp.nc', 'w') | ||
f.write(tmp) | ||
f.close() | ||
|
||
f = cdms2.open('tmp.nc') | ||
assert f['time'].clone().units == f['time'].units | ||
f.close() |