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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Apr 26 09:33:43 PDT 2017


4 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/284f5f6f7dc2/
Changeset:   284f5f6f7dc2
Branch:      yt
User:        ngoldbaum
Date:        2017-03-06 21:56:03+00:00
Summary:     cleanup show_fields.py, fix issues that cause it to fail at the moment
Affected #:  2 files

diff -r 1088ca4ac8d84017d1809a6f114c852297286350 -r 284f5f6f7dc287663cc382443b856e4391627e9e doc/helper_scripts/show_fields.py
--- a/doc/helper_scripts/show_fields.py
+++ b/doc/helper_scripts/show_fields.py
@@ -1,17 +1,14 @@
 import inspect
-from yt.mods import *
-from yt.testing import *
+from yt.testing import fake_random_ds
 import numpy as np
 from yt.utilities.cosmology import \
      Cosmology
-from yt.utilities.definitions import \
-    mpc_conversion, sec_conversion
 from yt.frontends.stream.fields import \
     StreamFieldInfo
 from yt.frontends.api import _frontends
 from yt.fields.derived_field import NullFunc
 import yt.frontends as frontends_module
-from yt.units.yt_array import YTArray, Unit
+from yt.units.yt_array import Unit
 from yt.units import dimensions
 
 fields, units = [], []
@@ -35,10 +32,11 @@
         return field
     return field[1]
 
+
 np.random.seed(int(0x4d3d3d3))
 units = [base_ds._get_field_info(*f).units for f in fields]
 fields = [_strip_ftype(f) for f in fields]
-ds = fake_random_ds(16, fields=fields, units=units, particles=True)
+ds = fake_random_ds(16, fields=fields, units=units, particles=1)
 ds.parameters["HydroMethod"] = "streaming"
 ds.parameters["EOSType"] = 1.0
 ds.parameters["EOSSoundSpeed"] = 1.0
@@ -160,6 +158,7 @@
                 print("  " + line)
             print()
 
+
 ds.index
 print_all_fields(ds.field_info)
 
@@ -183,6 +182,7 @@
         self.name = "(%s, '%s')" % (ftype, name)
         self.ptype = ptype
 
+
 current_frontends = [f for f in _frontends if f not in ["stream"]]
 
 for frontend in current_frontends:
@@ -194,7 +194,7 @@
         # Drop duplicate entry for GadgetHDF5, add special case for FieldInfo
         # entry
         dataset_names = ['GadgetDataset']
-        field_info_names = ['SPHFieldInfo']
+        field_info_names = ['GadgetFieldInfo']
     elif frontend == "boxlib":
         field_info_names = []
         for d in dataset_names:

diff -r 1088ca4ac8d84017d1809a6f114c852297286350 -r 284f5f6f7dc287663cc382443b856e4391627e9e yt/testing.py
--- a/yt/testing.py
+++ b/yt/testing.py
@@ -206,9 +206,11 @@
         if particle_fields is not None:
             for field, unit in zip(particle_fields, particle_field_units):
                 if field in ('particle_position', 'particle_velocity'):
-                    data['io', field] = (prng.random_sample((particles, 3)), unit)
+                    data['io', field] = (
+                        prng.random_sample((int(particles), 3)), unit)
                 else:
-                    data['io', field] = (prng.random_sample(size=particles), unit)
+                    data['io', field] = (
+                        prng.random_sample(size=int(particles)), unit)
         else:
             for f in ('particle_position_%s' % ax for ax in 'xyz'):
                 data['io', f] = (prng.random_sample(size=particles), 'code_length')


https://bitbucket.org/yt_analysis/yt/commits/3c7a7993562a/
Changeset:   3c7a7993562a
Branch:      yt
User:        ngoldbaum
Date:        2017-03-07 01:02:36+00:00
Summary:     Build field_list.rst using a sphinx extension
Affected #:  4 files

diff -r 284f5f6f7dc287663cc382443b856e4391627e9e -r 3c7a7993562ab58067e17169665230cf4a936885 doc/extensions/yt_showfields.py
--- /dev/null
+++ b/doc/extensions/yt_showfields.py
@@ -0,0 +1,22 @@
+import subprocess
+import sys
+from sphinx.util.compat import Directive
+
+def setup(app):
+    app.add_directive('yt_showfields', ShowFields)
+    setup.app = app
+    setup.config = app.config
+    setup.confdir = app.confdir
+
+class ShowFields(Directive):
+    required_arguments = 0
+    optional_arguments = 0
+
+    def run(self):
+        rst_file = self.state_machine.document.attributes['source']
+        lines = subprocess.check_output(
+            [sys.executable, './helper_scripts/show_fields.py'])
+        lines = lines.decode('utf8')
+        lines = lines.split('\n')
+        self.state_machine.insert_input(lines, rst_file)
+        return []

diff -r 284f5f6f7dc287663cc382443b856e4391627e9e -r 3c7a7993562ab58067e17169665230cf4a936885 doc/source/conf.py
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -32,7 +32,7 @@
 extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx',
               'sphinx.ext.pngmath', 'sphinx.ext.viewcode',
               'sphinx.ext.napoleon', 'yt_cookbook', 'yt_colormaps',
-              'config_help']
+              'config_help', 'yt_showfields']
 
 if not on_rtd:
     extensions.append('sphinx.ext.autosummary')

diff -r 284f5f6f7dc287663cc382443b856e4391627e9e -r 3c7a7993562ab58067e17169665230cf4a936885 doc/source/developing/building_the_docs.rst
--- a/doc/source/developing/building_the_docs.rst
+++ b/doc/source/developing/building_the_docs.rst
@@ -202,9 +202,7 @@
 :ref:`configuration-file`) to suppress large amounts of debug output from
 yt.
 
-To clean the docs build, use :code:`make clean`.  By default, :code:`make clean`
-will not delete the autogenerated API docs, so use :code:`make fullclean` to
-delete those as well.
+To clean the docs build, use :code:`make clean`.
 
 Building the Docs (Hybrid)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^

This diff is so big that we needed to truncate the remainder.

https://bitbucket.org/yt_analysis/yt/commits/dd571cd01726/
Changeset:   dd571cd01726
Branch:      yt
User:        ngoldbaum
Date:        2017-03-07 01:57:31+00:00
Summary:     mark yt_showfields extension as parallel safe
Affected #:  1 file

diff -r 3c7a7993562ab58067e17169665230cf4a936885 -r dd571cd01726d5029c3fa0105ac994d7f831fdb5 doc/extensions/yt_showfields.py
--- a/doc/extensions/yt_showfields.py
+++ b/doc/extensions/yt_showfields.py
@@ -11,6 +11,8 @@
 class ShowFields(Directive):
     required_arguments = 0
     optional_arguments = 0
+    parallel_read_safe = True
+    parallel_write_safe = True
 
     def run(self):
         rst_file = self.state_machine.document.attributes['source']


https://bitbucket.org/yt_analysis/yt/commits/6d72c60f4b94/
Changeset:   6d72c60f4b94
Branch:      yt
User:        ngoldbaum
Date:        2017-04-26 16:33:38+00:00
Summary:     Merged in ngoldbaum/yt (pull request #2539)

Build field_list.rst using a sphinx extension

Approved-by: Kacper Kowalik <xarthisius.kk at gmail.com>
Approved-by: Matt Turk <matthewturk at gmail.com>
Approved-by: Alexander Lindsay <al007 at illinois.edu>
Affected #:  6 files

diff -r 68f97dface72120a4494a4bc3c877d8ed6b5bbca -r 6d72c60f4b9474f3b43ca228db1a8ee6112a225a doc/extensions/yt_showfields.py
--- /dev/null
+++ b/doc/extensions/yt_showfields.py
@@ -0,0 +1,24 @@
+import subprocess
+import sys
+from sphinx.util.compat import Directive
+
+def setup(app):
+    app.add_directive('yt_showfields', ShowFields)
+    setup.app = app
+    setup.config = app.config
+    setup.confdir = app.confdir
+
+class ShowFields(Directive):
+    required_arguments = 0
+    optional_arguments = 0
+    parallel_read_safe = True
+    parallel_write_safe = True
+
+    def run(self):
+        rst_file = self.state_machine.document.attributes['source']
+        lines = subprocess.check_output(
+            [sys.executable, './helper_scripts/show_fields.py'])
+        lines = lines.decode('utf8')
+        lines = lines.split('\n')
+        self.state_machine.insert_input(lines, rst_file)
+        return []

diff -r 68f97dface72120a4494a4bc3c877d8ed6b5bbca -r 6d72c60f4b9474f3b43ca228db1a8ee6112a225a doc/helper_scripts/show_fields.py
--- a/doc/helper_scripts/show_fields.py
+++ b/doc/helper_scripts/show_fields.py
@@ -1,17 +1,14 @@
 import inspect
-from yt.mods import *
-from yt.testing import *
+from yt.testing import fake_random_ds
 import numpy as np
 from yt.utilities.cosmology import \
      Cosmology
-from yt.utilities.definitions import \
-    mpc_conversion, sec_conversion
 from yt.frontends.stream.fields import \
     StreamFieldInfo
 from yt.frontends.api import _frontends
 from yt.fields.derived_field import NullFunc
 import yt.frontends as frontends_module
-from yt.units.yt_array import YTArray, Unit
+from yt.units.yt_array import Unit
 from yt.units import dimensions
 
 fields, units = [], []
@@ -35,10 +32,11 @@
         return field
     return field[1]
 
+
 np.random.seed(int(0x4d3d3d3))
 units = [base_ds._get_field_info(*f).units for f in fields]
 fields = [_strip_ftype(f) for f in fields]
-ds = fake_random_ds(16, fields=fields, units=units, particles=True)
+ds = fake_random_ds(16, fields=fields, units=units, particles=1)
 ds.parameters["HydroMethod"] = "streaming"
 ds.parameters["EOSType"] = 1.0
 ds.parameters["EOSSoundSpeed"] = 1.0
@@ -160,6 +158,7 @@
                 print("  " + line)
             print()
 
+
 ds.index
 print_all_fields(ds.field_info)
 
@@ -183,6 +182,7 @@
         self.name = "(%s, '%s')" % (ftype, name)
         self.ptype = ptype
 
+
 current_frontends = [f for f in _frontends if f not in ["stream"]]
 
 for frontend in current_frontends:
@@ -194,7 +194,7 @@
         # Drop duplicate entry for GadgetHDF5, add special case for FieldInfo
         # entry
         dataset_names = ['GadgetDataset']
-        field_info_names = ['SPHFieldInfo']
+        field_info_names = ['GadgetFieldInfo']
     elif frontend == "boxlib":
         field_info_names = []
         for d in dataset_names:

diff -r 68f97dface72120a4494a4bc3c877d8ed6b5bbca -r 6d72c60f4b9474f3b43ca228db1a8ee6112a225a doc/source/conf.py
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -32,7 +32,7 @@
 extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx',
               'sphinx.ext.mathjax', 'sphinx.ext.viewcode',
               'sphinx.ext.napoleon', 'yt_cookbook', 'yt_colormaps',
-              'config_help']
+              'config_help', 'yt_showfields']
 
 if not on_rtd:
     extensions.append('sphinx.ext.autosummary')

diff -r 68f97dface72120a4494a4bc3c877d8ed6b5bbca -r 6d72c60f4b9474f3b43ca228db1a8ee6112a225a doc/source/developing/building_the_docs.rst
--- a/doc/source/developing/building_the_docs.rst
+++ b/doc/source/developing/building_the_docs.rst
@@ -202,9 +202,7 @@
 :ref:`configuration-file`) to suppress large amounts of debug output from
 yt.
 
-To clean the docs build, use :code:`make clean`.  By default, :code:`make clean`
-will not delete the autogenerated API docs, so use :code:`make fullclean` to
-delete those as well.
+To clean the docs build, use :code:`make clean`.
 
 Building the Docs (Hybrid)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^

This diff is so big that we needed to truncate the remainder.

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