New issue 1016: Particle callback doesn't handle quantities correctly
https://bitbucket.org/yt_analysis/yt/issue/1016/particle-callback-doesnt-ha…
Nathan Goldbaum:
The following test script:
```
#!python
import yt
from yt.units import Mpc
ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030')
p = yt.SlicePlot(ds, 2, 'density')
p.annotate_particles(0.3*Mpc)
p.save()
```
errors out with the following traceback:
```
#!python
Traceback (most recent call last):
File "test.py", line 7, in <module>
p.save()
File "/Users/goldbaum/Documents/yt-hg/yt/visualization/plot_container.py", line 74, in newfunc
args[0].run_callbacks()
File "/Users/goldbaum/Documents/yt-hg/yt/visualization/plot_window.py", line 1003, in run_callbacks
sys.exc_info()[2])
File "/Users/goldbaum/Documents/yt-hg/yt/visualization/plot_window.py", line 999, in run_callbacks
callback(cbw)
File "/Users/goldbaum/Documents/yt-hg/yt/visualization/plot_modifications.py", line 1440, in __call__
reg = self._get_region((x0,x1), (y0,y1), plot.data.axis, data)
File "/Users/goldbaum/Documents/yt-hg/yt/visualization/plot_modifications.py", line 1472, in _get_region
LE[zax] = data.center[zax].ndarray_view() - self.width*0.5
File "/Users/goldbaum/Documents/yt-hg/yt/units/yt_array.py", line 750, in __rsub__
lo = sanitize_units_add(self, left_object, "subtraction")
File "/Users/goldbaum/Documents/yt-hg/yt/units/yt_array.py", line 134, in sanitize_units_add
raise YTUnitOperationError(op_string, inp.units, dimensionless)
yt.utilities.exceptions.YTPlotCallbackError: annotate_particles callback failed with the following error: The subtraction operator for YTArrays with units (Mpc) and (1) is not well defined.
```
_______________________________________________
yt-dev mailing list
yt-dev(a)lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
Hi everyone,
I think this is something we should consider adopting as well in yt.
Britton
---------- Forwarded message ----------
From: Thomas Robitaille <thomas.robitaille(a)gmail.com>
Date: Tue, Apr 28, 2015 at 10:11 AM
Subject: [astropy-dev] Astropy Community Code of Conduct
To: astropy-dev <astropy-dev(a)googlegroups.com>
Hi everyone,
During the "Python in Astronomy" workshop in Leiden last week, a
number of participants decided to get together to write a code of
conduct for the Astropy project. We now have a final draft ready, and
would like to solicit feedback on this version, which you can find
here:
https://docs.google.com/document/d/1yLObQMqP66x6MNuHXFpW_4dLPBtNp--9BHxfG8Y…
Please let us know by the end of this week if you have any comments! You
can make use of the commenting functionality in Google Docs, but
please don't use the 'suggested edits' functionality since that will
make it harder to read for others.
We plan to extend this code of conduct beyond simply the Astropy
community, to e.g. the new Python users in Astronomy Facebook group
[1], and future Python in Astronomy meetings, but having it as the
Astropy community code of conduct for now would be a good place to
start.
Thanks!
Tom
[1] https://www.facebook.com/groups/1596306890613995/
--
You received this message because you are subscribed to the Google Groups
"astropy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to astropy-dev+unsubscribe(a)googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
_______________________________________________
yt-dev mailing list
yt-dev(a)lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
Dear yt developer,
I would like to use yt to visualise the output from the SimpleX radiative transfer code.
Due to the "Voroni-Delaunay" unstructured grid use in the code the output ‘cells’ are tetrahedra.
>From a firs look into the code and in the documentation, I was not able to find if this kind of unstructured grid are already supported in yt or if something similar is under development.
If one of the other code have something similar already implemented that I can use as guideline it would be incredibly helpful!
Thanks,
Nicola Clementel
_______________________________________________
yt-dev mailing list
yt-dev(a)lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
New issue 1014: annotate velocity in on-cubic datasets
https://bitbucket.org/yt_analysis/yt/issue/1014/annotate-velocity-in-on-cub…
Anonymous:
It looks like the annotate_velocity method on SlicePlots selects a number of points uniformly distributed in the x and y coordinates but this does not work well for slices where one of the dimensions is much larger than the other. Is it possible to scale the number of displayed arrows with the size of each axis of the domain?
_______________________________________________
yt-dev mailing list
yt-dev(a)lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
New issue 1013: Consider using __numpy_ufunc__ from numpy 1.10 for YTArray
https://bitbucket.org/yt_analysis/yt/issue/1013/consider-using-__numpy_ufun…
Nathan Goldbaum:
This new hook in ndarray's subclassing machinery may help us avoid a significant amount of boilerplate in the definition of YTArray. In addition, it may also allow us to fix currently un-resolveable issues with subclassing ndarray, e.g. this example:
```
#!
>>> import numpy as np
>>> from yt.units import g
>>> a = np.array([1,2,3])
>>> print a*g
[ 1. 2. 3.] g
a*g returns a YTArray, an ndarray subclass that knows about units.
"plain" ndarrays are treated as unitless arrays.
>>> print g
1.0 g
>>> a *= g
>>> print a
array([1, 2, 3])
I don't seem to have a way to override this behavior, since
this invokes __imul__ in the ndarray class rather than __rmul__
in my subclass
>>> a = [1,2,3]
>>> print a*g
[ 1. 2. 3.] g
>>> a *= g
>>> a
YTArray([ 1., 2., 3.]) g
Things behave correctly when I use lists rather than ndarray.
```
Unfortunately this is blocked until numpy 1.10 is released. We will also need to be careful to not break compatibility with older versions of numpy, and be sure to not make the code paths followed in different numpy versions different.
_______________________________________________
yt-dev mailing list
yt-dev(a)lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
New issue 1012: FixedResolutionBuffer with non-unit aspect ratios fails
https://bitbucket.org/yt_analysis/yt/issue/1012/fixedresolutionbuffer-with-…
Anonymous:
Attempting to use to_frb with more than one dimension fails. Failures seem to be related to yt trying to parse iterable arguments as numbers with units.
```
#!python
>>> proj = ds.proj("density","z")
>>> Delta = (0.1,'code_length')
>>> dx = (1./512,'code_length')
>>> frb=proj.to_frb(Delta,dx)
works great!
>>> frb=proj.to_frb( [Delta, Delta],[dx,dx])
raceback (most recent call last):
File "<stdin>", line 1, in <module>
File "tmp.py", line 22, in <module>
frb=proj.to_frb( [Delta, Delta],[dx,dx])
File "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/data_objects/data_containers.py", line 909, in to_frb
width = self.ds.quan(w, input_units = u)
File "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/units/yt_array.py", line 1153, in __new__
raise RuntimeError("YTQuantity values must be numeric")
RuntimeError: YTQuantity values must be numeric
Also I tried using a ds.arr:
>>> Delta = ds.arr([0.1,0.1],'code_length')
>>> dx = ds.arr([1./512, 1./512], 'code_length')
>>> frb=proj.to_frb( Delta, dx)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "tmp.py", line 26, in <module>
frb=proj.to_frb( Delta, dx)
File "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/data_objects/data_containers.py", line 909, in to_frb
width = self.ds.quan(w, input_units = u)
File "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/units/yt_array.py", line 1155, in __new__
dtype=dtype)
File "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/units/yt_array.py", line 308, in __new__
input_array.units = Unit(input_units, registry=registry)
File "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/units/unit_object.py", line 169, in __new__
% (unit_expr, type(unit_expr)))
yt.units.unit_object.UnitParseError: Unit representation must be a string or sympy Expr. 0.1 code_length has type <class 'yt.units.yt_array.YTQuantity'>.
```
_______________________________________________
yt-dev mailing list
yt-dev(a)lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org