[yt-svn] commit/yt: 2 new changesets
Bitbucket
commits-noreply at bitbucket.org
Fri Jan 18 12:21:15 PST 2013
2 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/8c4d68f82036/
changeset: 8c4d68f82036
branch: yt
user: samskillman
date: 2013-01-18 21:16:17
summary: Adding periodic_position to math_utils.py
affected #: 2 files
diff -r 04fa9a7d799c59d00469ee30cc3f91978eca3b46 -r 8c4d68f82036d661419006a19058b0ff9c2a664e yt/mods.py
--- a/yt/mods.py
+++ b/yt/mods.py
@@ -143,7 +143,7 @@
# Import some helpful math utilities
from yt.utilities.math_utils import \
- ortho_find, quartiles
+ ortho_find, quartiles, periodic_position
# We load plugins. Keep in mind, this can be fairly dangerous -
diff -r 04fa9a7d799c59d00469ee30cc3f91978eca3b46 -r 8c4d68f82036d661419006a19058b0ff9c2a664e yt/utilities/math_utils.py
--- a/yt/utilities/math_utils.py
+++ b/yt/utilities/math_utils.py
@@ -30,6 +30,30 @@
import numpy as np
import math
+def periodic_position(pos, pf):
+ r"""Assuming periodicity, find the periodic position within the domain.
+
+ Parameters
+ ----------
+ pos : array
+ An array of floats.
+
+ pf : StaticOutput
+ A simulation static output.
+
+ Examples
+ --------
+ >>> a = np.array([1.1, 0.5, 0.5])
+ >>> data = {'Density':np.ones([32,32,32])}
+ >>> pf = load_uniform_grid(data, [32,32,32], 1.0)
+ >>> ppos = periodic_position(a, pf)
+ >>> ppos
+ array([ 0.1, 0.5, 0.5])
+ """
+
+ off = (pos - pf.domain_left_edge) % pf.domain_width
+ return pf.domain_left_edge + off
+
def periodic_dist(a, b, period):
r"""Find the Euclidian periodic distance between two points.
https://bitbucket.org/yt_analysis/yt/commits/958de8ec7d14/
changeset: 958de8ec7d14
branch: yt
user: samskillman
date: 2013-01-18 21:16:48
summary: Merging
affected #: 3 files
diff -r 8c4d68f82036d661419006a19058b0ff9c2a664e -r 958de8ec7d1489664bd88f57054352cee0c82559 yt/analysis_modules/halo_finding/halo_objects.py
--- a/yt/analysis_modules/halo_finding/halo_objects.py
+++ b/yt/analysis_modules/halo_finding/halo_objects.py
@@ -835,6 +835,9 @@
self.bin_count = None
self.overdensity = None
self.indices = np.array([]) # Never used for a LoadedHalo.
+ self._saved_fields = {}
+ self._ds_sort = None
+ self._particle_mask = None
# A supplementary data dict.
if supp is None:
self.supp = {}
diff -r 8c4d68f82036d661419006a19058b0ff9c2a664e -r 958de8ec7d1489664bd88f57054352cee0c82559 yt/data_objects/data_containers.py
--- a/yt/data_objects/data_containers.py
+++ b/yt/data_objects/data_containers.py
@@ -3674,7 +3674,13 @@
Inside = np.zeros(grid["x"].shape, dtype = 'float64')
dim = grid["x"].shape
# need this to take into account non-cube root grid tiles
- dot_evec = np.zeros([3, dim[0], dim[1], dim[2]])
+ if (len(dim) == 1):
+ dot_evec = np.zeros([3, dim[0]])
+ elif (len(dim) == 2):
+ dot_evec = np.zeros([3, dim[0], dim[1]])
+ elif (len(dim) == 3):
+ dot_evec = np.zeros([3, dim[0], dim[1], dim[2]])
+
for i, ax in enumerate('xyz'):
# distance to center
ar = grid[ax]-self.center[i]
diff -r 8c4d68f82036d661419006a19058b0ff9c2a664e -r 958de8ec7d1489664bd88f57054352cee0c82559 yt/utilities/command_line.py
--- a/yt/utilities/command_line.py
+++ b/yt/utilities/command_line.py
@@ -1437,6 +1437,9 @@
print
print "Recall you can create a new SSH tunnel dynamically by pressing"
print "~C and then typing -L%s:localhost:%s" % (app.port, app.port)
+ print "where the first number is the port on your local machine. "
+ print
+ print "If you are using %s on your machine already, try -L8889:localhost:%s" % (app.port, app.port)
print
print "Additionally, while in the notebook, we recommend you start by"
print "replacing 'yt.mods' with 'yt.imods' like so:"
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