[yt-svn] commit/yt: 3 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Mon Mar 24 18:42:42 PDT 2014


3 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/66cc4a879597/
Changeset:   66cc4a879597
Branch:      yt-3.0
User:        Kenza Arraki
Date:        2014-03-23 20:48:22
Summary:     NMSU-ART front end should now automatically detect particle data files matching the given prefix and suffix information in definitions.py. Created a new matching system within the find_files def in data_structures.py.
Affected #:  1 file

diff -r afbb6c1c19fd04fb97eab241ceb4b8382ce206c8 -r 66cc4a87959716f79e8419fe5aeec17496659020 yt/frontends/art/data_structures.py
--- a/yt/frontends/art/data_structures.py
+++ b/yt/frontends/art/data_structures.py
@@ -14,7 +14,6 @@
 #-----------------------------------------------------------------------------
 import numpy as np
 import os.path
-import glob
 import stat
 import weakref
 import cStringIO
@@ -208,9 +207,11 @@
             # if this attribute is already set skip it
             if getattr(self, "_file_"+filetype, None) is not None:
                 continue
-            stripped = file_amr.replace(base_prefix, prefix)
-            stripped = stripped.replace(base_suffix, suffix)
-            match, = difflib.get_close_matches(stripped, possibles, 1, 0.6)
+            match = None
+            for possible in possibles:
+                if possible.endswith(suffix):
+                    if os.path.basename(possible).startswith(prefix):
+                        match = possible
             if match is not None:
                 mylog.info('discovered %s:%s', filetype, match)
                 setattr(self, "_file_"+filetype, match)


https://bitbucket.org/yt_analysis/yt/commits/19a50ff63350/
Changeset:   19a50ff63350
Branch:      yt-3.0
User:        karraki
Date:        2014-03-24 21:10:05
Summary:     NMSU-ART automatic particle file detection
Affected #:  3 files

diff -r 66cc4a87959716f79e8419fe5aeec17496659020 -r 19a50ff63350e44b374c40184d8e30627d2b47c9 yt/frontends/art/data_structures.py
--- a/yt/frontends/art/data_structures.py
+++ b/yt/frontends/art/data_structures.py
@@ -202,6 +202,7 @@
         particle header, star files, etc.
         """
         base_prefix, base_suffix = filename_pattern['amr']
+        aexpstr = 'a'+file_amr.rsplit('a',1)[1].replace(base_suffix,'')
         possibles = glob.glob(os.path.dirname(file_amr)+"/*")
         for filetype, (prefix, suffix) in filename_pattern.iteritems():
             # if this attribute is already set skip it
@@ -209,7 +210,7 @@
                 continue
             match = None
             for possible in possibles:
-                if possible.endswith(suffix):
+                if possible.endswith(aexpstr+suffix):
                     if os.path.basename(possible).startswith(prefix):
                         match = possible
             if match is not None:

diff -r 66cc4a87959716f79e8419fe5aeec17496659020 -r 19a50ff63350e44b374c40184d8e30627d2b47c9 yt/frontends/art/tests/test_outputs.py
--- a/yt/frontends/art/tests/test_outputs.py
+++ b/yt/frontends/art/tests/test_outputs.py
@@ -1,5 +1,5 @@
 """
-ART frontend tests using SFG1 a=0.330
+ART frontend tests using D9p a=0.500
 
 
 
@@ -22,20 +22,22 @@
     data_dir_load
 from yt.frontends.art.api import ARTDataset
 
-_fields = ("Density", "particle_mass", ("all", "particle_position_x"))
+_fields = ("Temperature", "Density", "particle_mass", ("all", "particle_position_x"))
 
-sfg1 = "10MpcBox_csf512_a0.330.d"
+d9p = "D9p_500/10MpcBox_HartGal_csf_a0.500.d"
 
-
- at requires_pf(sfg1, big_data=True)
-def test_sfg1():
-    pf = data_dir_load(sfg1)
-    yield assert_equal, str(pf), "10MpcBox_csf512_a0.330.d"
+ at requires_pf(d9p, big_data=True)
+def test_d9p():
+    pf = data_dir_load(d9p)
+    yield assert_equal, str(pf), "10MpcBox_HartGal_csf_a0.500.d"
+    for test in big_patch_amr(d9p, _fields):
+        test_d9p.__name__ = test.description
+        yield test
     dso = [None, ("sphere", ("max", (0.1, 'unitary')))]
     for field in _fields:
         for axis in [0, 1, 2]:
             for ds in dso:
                 for weight_field in [None, "Density"]:
                     yield PixelizedProjectionValuesTest(
-                        sfg1, axis, field, weight_field,
+                        d9p, axis, field, weight_field,
                         ds)


https://bitbucket.org/yt_analysis/yt/commits/85ddb514c186/
Changeset:   85ddb514c186
Branch:      yt-3.0
User:        MatthewTurk
Date:        2014-03-25 02:42:36
Summary:     Merged in karraki/yt/yt-3.0 (pull request #754)

NMSU-ART automatic find particle files
Affected #:  3 files

diff -r 287b7b880c2bc8900b14d18976bea7c10689d318 -r 85ddb514c1861a6d7c8ee3836511f75ddfac8c85 yt/frontends/art/data_structures.py
--- a/yt/frontends/art/data_structures.py
+++ b/yt/frontends/art/data_structures.py
@@ -14,7 +14,6 @@
 #-----------------------------------------------------------------------------
 import numpy as np
 import os.path
-import glob
 import stat
 import weakref
 import cStringIO
@@ -203,14 +202,17 @@
         particle header, star files, etc.
         """
         base_prefix, base_suffix = filename_pattern['amr']
+        aexpstr = 'a'+file_amr.rsplit('a',1)[1].replace(base_suffix,'')
         possibles = glob.glob(os.path.dirname(file_amr)+"/*")
         for filetype, (prefix, suffix) in filename_pattern.iteritems():
             # if this attribute is already set skip it
             if getattr(self, "_file_"+filetype, None) is not None:
                 continue
-            stripped = file_amr.replace(base_prefix, prefix)
-            stripped = stripped.replace(base_suffix, suffix)
-            match, = difflib.get_close_matches(stripped, possibles, 1, 0.6)
+            match = None
+            for possible in possibles:
+                if possible.endswith(aexpstr+suffix):
+                    if os.path.basename(possible).startswith(prefix):
+                        match = possible
             if match is not None:
                 mylog.info('discovered %s:%s', filetype, match)
                 setattr(self, "_file_"+filetype, match)

diff -r 287b7b880c2bc8900b14d18976bea7c10689d318 -r 85ddb514c1861a6d7c8ee3836511f75ddfac8c85 yt/frontends/art/tests/test_outputs.py
--- a/yt/frontends/art/tests/test_outputs.py
+++ b/yt/frontends/art/tests/test_outputs.py
@@ -1,5 +1,5 @@
 """
-ART frontend tests using SFG1 a=0.330
+ART frontend tests using D9p a=0.500
 
 
 
@@ -22,20 +22,22 @@
     data_dir_load
 from yt.frontends.art.api import ARTDataset
 
-_fields = ("Density", "particle_mass", ("all", "particle_position_x"))
+_fields = ("Temperature", "Density", "particle_mass", ("all", "particle_position_x"))
 
-sfg1 = "10MpcBox_csf512_a0.330.d"
+d9p = "D9p_500/10MpcBox_HartGal_csf_a0.500.d"
 
-
- at requires_pf(sfg1, big_data=True)
-def test_sfg1():
-    pf = data_dir_load(sfg1)
-    yield assert_equal, str(pf), "10MpcBox_csf512_a0.330.d"
+ at requires_pf(d9p, big_data=True)
+def test_d9p():
+    pf = data_dir_load(d9p)
+    yield assert_equal, str(pf), "10MpcBox_HartGal_csf_a0.500.d"
+    for test in big_patch_amr(d9p, _fields):
+        test_d9p.__name__ = test.description
+        yield test
     dso = [None, ("sphere", ("max", (0.1, 'unitary')))]
     for field in _fields:
         for axis in [0, 1, 2]:
             for ds in dso:
                 for weight_field in [None, "Density"]:
                     yield PixelizedProjectionValuesTest(
-                        sfg1, axis, field, weight_field,
+                        d9p, axis, field, weight_field,
                         ds)

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