[yt-svn] commit/yt: ngoldbaum: Merged in ngoldbaum/yt (pull request #2533)
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Wed Mar 15 12:02:58 PDT 2017
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/commits/5d0ca754ce74/
Changeset: 5d0ca754ce74
Branch: yt
User: ngoldbaum
Date: 2017-03-15 19:02:53+00:00
Summary: Merged in ngoldbaum/yt (pull request #2533)
Remove unused yt.utilities.exodusII_reader module
Approved-by: Kacper Kowalik
Approved-by: Britton Smith
Approved-by: Andrew Myers
Affected #: 1 file
diff -r 95401107ce0793c6b74d10c336f0633aaee990d5 -r 5d0ca754ce74cc7e3f4dac94257713032073ec5b yt/utilities/exodusII_reader.py
--- a/yt/utilities/exodusII_reader.py
+++ /dev/null
@@ -1,51 +0,0 @@
-import string
-from itertools import takewhile
-from netCDF4 import Dataset
-import numpy as np
-from yt.config import ytcfg
-import os
-import warnings
-
-
-def sanitize_string(s):
- s = "".join(_ for _ in takewhile(lambda a: a in string.printable, s))
- return s
-
-
-def get_data(fn):
- warnings.warn("The yt.utilities.exodusII_reader module is deprecated "
- "and will be removed in a future release. "
- "Please use the normal yt.load() command to access "
- "your data instead.")
- try:
- f = Dataset(fn)
- except RuntimeError:
- f = Dataset(os.path.join(ytcfg.get("yt", "test_data_dir"), fn))
- fvars = f.variables
- # Is this correct?
- etypes = fvars["eb_status"][:]
- nelem = etypes.shape[0]
- varnames = [sanitize_string(v.tostring()) for v in
- fvars["name_elem_var"][:]]
- nodnames = [sanitize_string(v.tostring()) for v in
- fvars["name_nod_var"][:]]
- coord = np.array([fvars["coord%s" % ax][:]
- for ax in 'xyz']).transpose().copy()
- coords = []
- connects = []
- data = []
- for i in range(nelem):
- connects.append(fvars["connect%s" % (i+1)][:].astype("i8"))
- ci = connects[-1]
- coords.append(coord) # Same for all
- vals = {}
- for j, v in enumerate(varnames):
- values = fvars["vals_elem_var%seb%s" % (j+1, i+1)][:]
- vals['gas', v] = values.astype("f8")[-1, :]
- for j, v in enumerate(nodnames):
- # We want just for this set of nodes all the node variables
- # Use (ci - 1) to get these values
- values = fvars["vals_nod_var%s" % (j+1)][:]
- vals['gas', v] = values.astype("f8")[-1, ci - 1, ...]
- data.append(vals)
- return coords, connects, data
Repository URL: https://bitbucket.org/yt_analysis/yt/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list