Problem running volume rendering example
Hi yt-users, I’ve wanted to have a look into the volume rendering examples. However, when I run the following code from the examples (https://yt-project.org/doc/quickstart/volume_rendering.html) import yt ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030") sc = yt.create_scene(ds) sc.camera.set_width(ds.quan(20, 'kpc')) source = sc.sources['source_00'] tf = yt.ColorTransferFunction((-28, -24)) tf.add_layers(4, w=0.01) source.set_transfer_function(tf) sc.show() I get the following (error) output: (full output, see below) : Support for the <ufunc 'clip'> ufunc with 3 inputs has not beenadded to YTArray. Am I missing something? installation is yt 3.5.1 numpy 1.17. matplotlib 3.1.1 Thanks for any help Christoph --------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) ~/src/python_virtual_env/lib/python3.7/site-packages/IPython/core/formatters.py in __call__(self, obj) 343 method = get_real_method(obj, self.print_method) 344 if method is not None: --> 345 return method() 346 return None 347 else: ~/src/python_virtual_env/lib/python3.7/site-packages/yt/visualization/volume_rendering/scene.py in _repr_png_(self) 926 png = self._last_render.write_png(filename=None, 927 sigma_clip=self._sigma_clip, --> 928 background='black') 929 self._sigma_clip = None 930 return png ~/src/python_virtual_env/lib/python3.7/site-packages/yt/data_objects/image_array.py in write_png(self, filename, sigma_clip, background, rescale, clip_ratio) 287 """ 288 if rescale: --> 289 scaled = self.rescale(inline=False) 290 else: 291 scaled = self ~/src/python_virtual_env/lib/python3.7/site-packages/yt/data_objects/image_array.py in rescale(self, cmax, amax, inline) 240 np.multiply(self[:, :, 3], 1.0/amax, out[:, :, 3]) 241 --> 242 np.clip(out, 0.0, 1.0, out) 243 return out 244 <__array_function__ internals> in clip(*args, **kwargs) ~/src/python_virtual_env/lib/python3.7/site-packages/numpy/core/fromnumeric.py in clip(a, a_min, a_max, out, **kwargs) 2035 2036 """ -> 2037 return _wrapfunc(a, 'clip', a_min, a_max, out=out, **kwargs) 2038 2039 ~/src/python_virtual_env/lib/python3.7/site-packages/numpy/core/fromnumeric.py in _wrapfunc(obj, method, *args, **kwds) 59 60 try: ---> 61 return bound(*args, **kwds) 62 except TypeError: 63 # A TypeError occurs if the object does have such a method in its ~/src/python_virtual_env/lib/python3.7/site-packages/numpy/core/_methods.py in _clip(a, min, max, out, casting, **kwargs) 130 else: 131 return _clip_dep_invoke_with_casting( --> 132 um.clip, a, min, max, out=out, casting=casting, **kwargs) 133 134 def _mean(a, axis=None, dtype=None, out=None, keepdims=False): ~/src/python_virtual_env/lib/python3.7/site-packages/numpy/core/_methods.py in _clip_dep_invoke_with_casting(ufunc, out, casting, *args, **kwargs) 83 # try to deal with broken casting rules 84 try: ---> 85 return ufunc(*args, out=out, **kwargs) 86 except _exceptions._UFuncOutputCastingError as e: 87 # Numpy 1.17.0, 2019-02-24 ~/src/python_virtual_env/lib/python3.7/site-packages/yt/units/yt_array.py in __array_ufunc__(self, ufunc, method, *inputs, **kwargs) 1399 raise RuntimeError( 1400 "Support for the %s ufunc with %i inputs has not been" -> 1401 "added to YTArray." % (str(ufunc), len(inputs))) 1402 if unit is None: 1403 out_arr = np.array(out_arr, copy=False) RuntimeError : Support for the <ufunc 'clip'> ufunc with 3 inputs has not beenadded to YTArray. <Scene Object>: Sources: source_00: <Volume Source>:YTRegion (galaxy0030): , center=[1.543e+24 1.543e+24 1.543e+24] cm, left_edge=[0. 0. 0.] cm, right_edge=[3.086e+24 3.086e+24 3.086e+24] cm transfer_function:<Color Transfer Function Object>: x_bounds:[-28, -24] nbins:256 features: ('gaussian', 'location(x):-28', 'width(x):0.01', 'height(y):(0.43, 0.024, 0.047, 0.001)') ('gaussian', 'location(x):-27', 'width(x):0.01', 'height(y):(0.34, 0.34, 0.68, 0.01)') ('gaussian', 'location(x):-25', 'width(x):0.01', 'height(y):(0.66, 0.66, 0.32, 0.1)') ('gaussian', 'location(x):-24', 'width(x):0.01', 'height(y):(0.98, 0.98, 0.91, 1)') Camera: <Camera Object>: position:[1. 1. 1.] code_length focus:[0.5 0.5 0.5] code_length north_vector:[ 0.81649658 -0.40824829 -0.40824829] dimensionless width:[0.01999791 0.01999791 0.01999791] unitary light:None resolution:(512, 512) Lens: <Lens Object>: lens_type:plane-parallel viewpoint:[-11545.30474893 -11545.30474893 -11545.30474893] code_length
Hi Christoph, THis looks like a definite error in yt -- can you file a bug and I'll address it? On Sat, Aug 3, 2019 at 3:52 PM Christoph Schaefer <cm.schaefer@gmail.com> wrote:
Hi yt-users,
I’ve wanted to have a look into the volume rendering examples. However, when I run the following code from the examples (https://yt-project.org/doc/quickstart/volume_rendering.html)
import yt
ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030") sc = yt.create_scene(ds)
sc.camera.set_width(ds.quan(20, 'kpc'))
source = sc.sources['source_00']
tf = yt.ColorTransferFunction((-28, -24)) tf.add_layers(4, w=0.01)
source.set_transfer_function(tf)
sc.show()
I get the following (error) output: (full output, see below)
: Support for the <ufunc 'clip'> ufunc with 3 inputs has not beenadded to YTArray.
Am I missing something?
installation is yt 3.5.1 numpy 1.17. matplotlib 3.1.1
Thanks for any help
Christoph
--------------------------------------------------------------------------- RuntimeError Traceback (most recent call last)
~/src/python_virtual_env/lib/python3.7/site-packages/IPython/core/formatters.py in __call__(self, obj) 343 method = get_real_method(obj, self.print_method) 344 if method is not None: --> 345 return method() 346 return None 347 else:
~/src/python_virtual_env/lib/python3.7/site-packages/yt/visualization/volume_rendering/scene.py in _repr_png_(self) 926 png = self._last_render.write_png(filename=None,
927 sigma_clip=self._sigma_clip, --> 928 background='black')
929 self._sigma_clip = None 930 return png
~/src/python_virtual_env/lib/python3.7/site-packages/yt/data_objects/image_array.py in write_png(self, filename, sigma_clip, background, rescale, clip_ratio) 287 """
288 if rescale: --> 289 scaled = self.rescale(inline=False) 290 else: 291 scaled = self
~/src/python_virtual_env/lib/python3.7/site-packages/yt/data_objects/image_array.py in rescale(self, cmax, amax, inline) 240 np.multiply(self[:, :, 3], 1.0/amax, out[:, :, 3]) 241
--> 242 np.clip(out, 0.0, 1.0, out) 243 return out
244
<__array_function__ internals> in clip(*args, **kwargs)
~/src/python_virtual_env/lib/python3.7/site-packages/numpy/core/fromnumeric.py in clip(a, a_min, a_max, out, **kwargs) 2035
2036 """
-> 2037 return _wrapfunc(a, 'clip', a_min, a_max, out=out, **kwargs) 2038
2039
~/src/python_virtual_env/lib/python3.7/site-packages/numpy/core/fromnumeric.py in _wrapfunc(obj, method, *args, **kwds) 59
60 try: ---> 61 return bound(*args, **kwds) 62 except TypeError: 63 # A TypeError occurs if the object does have such a method in its
~/src/python_virtual_env/lib/python3.7/site-packages/numpy/core/_methods.py in _clip(a, min, max, out, casting, **kwargs) 130 else: 131 return _clip_dep_invoke_with_casting(
--> 132 um.clip, a, min, max, out=out, casting=casting, **kwargs)
133
134 def _mean(a, axis=None, dtype=None, out=None, keepdims=False):
~/src/python_virtual_env/lib/python3.7/site-packages/numpy/core/_methods.py in _clip_dep_invoke_with_casting(ufunc, out, casting, *args, **kwargs) 83 # try to deal with broken casting rules 84 try: ---> 85 return ufunc(*args, out=out, **kwargs) 86 except _exceptions._UFuncOutputCastingError as e: 87 # Numpy 1.17.0, 2019-02-24
~/src/python_virtual_env/lib/python3.7/site-packages/yt/units/yt_array.py in __array_ufunc__(self, ufunc, method, *inputs, **kwargs) 1399 raise RuntimeError(
1400 "Support for the %s ufunc with %i inputs has not been" -> 1401 "added to YTArray." % (str(ufunc), len(inputs)))
1402 if unit is None: 1403 out_arr = np.array(out_arr, copy=False)
RuntimeError : Support for the <ufunc 'clip'> ufunc with 3 inputs has not beenadded to YTArray.
<Scene Object>: Sources: source_00: <Volume Source>:YTRegion (galaxy0030): , center=[1.543e+24 1.543e+24 1.543e+24] cm, left_edge=[0. 0. 0.] cm, right_edge=[3.086e+24 3.086e+24 3.086e+24] cm transfer_function:<Color Transfer Function Object>: x_bounds:[-28, -24] nbins:256 features: ('gaussian', 'location(x):-28', 'width(x):0.01', 'height(y):(0.43, 0.024, 0.047, 0.001)') ('gaussian', 'location(x):-27', 'width(x):0.01', 'height(y):(0.34, 0.34, 0.68, 0.01)') ('gaussian', 'location(x):-25', 'width(x):0.01', 'height(y):(0.66, 0.66, 0.32, 0.1)') ('gaussian', 'location(x):-24', 'width(x):0.01', 'height(y):(0.98, 0.98, 0.91, 1)')
Camera: <Camera Object>: position:[1. 1. 1.] code_length focus:[0.5 0.5 0.5] code_length north_vector:[ 0.81649658 -0.40824829 -0.40824829] dimensionless width:[0.01999791 0.01999791 0.01999791] unitary light:None resolution:(512, 512) Lens: <Lens Object>: lens_type:plane-parallel viewpoint:[-11545.30474893 -11545.30474893 -11545.30474893] code_length _______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
I think this is a thing related to NumPy 1.17, since we’re getting Appveyor test failures related to this.
On Aug 5, 2019, at 11:56 AM, Matthew Turk <matthewturk@gmail.com> wrote:
Hi Christoph,
THis looks like a definite error in yt -- can you file a bug and I'll address it?
On Sat, Aug 3, 2019 at 3:52 PM Christoph Schaefer <cm.schaefer@gmail.com> wrote:
Hi yt-users,
I’ve wanted to have a look into the volume rendering examples. However, when I run the following code from the examples (https://yt-project.org/doc/quickstart/volume_rendering.html)
import yt
ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030") sc = yt.create_scene(ds)
sc.camera.set_width(ds.quan(20, 'kpc'))
source = sc.sources['source_00']
tf = yt.ColorTransferFunction((-28, -24)) tf.add_layers(4, w=0.01)
source.set_transfer_function(tf)
sc.show()
I get the following (error) output: (full output, see below)
: Support for the <ufunc 'clip'> ufunc with 3 inputs has not beenadded to YTArray.
Am I missing something?
installation is yt 3.5.1 numpy 1.17. matplotlib 3.1.1
Thanks for any help
Christoph
--------------------------------------------------------------------------- RuntimeError Traceback (most recent call last)
~/src/python_virtual_env/lib/python3.7/site-packages/IPython/core/formatters.py in __call__(self, obj) 343 method = get_real_method(obj, self.print_method) 344 if method is not None: --> 345 return method() 346 return None 347 else:
~/src/python_virtual_env/lib/python3.7/site-packages/yt/visualization/volume_rendering/scene.py in _repr_png_(self) 926 png = self._last_render.write_png(filename=None,
927 sigma_clip=self._sigma_clip, --> 928 background='black')
929 self._sigma_clip = None 930 return png
~/src/python_virtual_env/lib/python3.7/site-packages/yt/data_objects/image_array.py in write_png(self, filename, sigma_clip, background, rescale, clip_ratio) 287 """
288 if rescale: --> 289 scaled = self.rescale(inline=False) 290 else: 291 scaled = self
~/src/python_virtual_env/lib/python3.7/site-packages/yt/data_objects/image_array.py in rescale(self, cmax, amax, inline) 240 np.multiply(self[:, :, 3], 1.0/amax, out[:, :, 3]) 241
--> 242 np.clip(out, 0.0, 1.0, out) 243 return out
244
<__array_function__ internals> in clip(*args, **kwargs)
~/src/python_virtual_env/lib/python3.7/site-packages/numpy/core/fromnumeric.py in clip(a, a_min, a_max, out, **kwargs) 2035
2036 """
-> 2037 return _wrapfunc(a, 'clip', a_min, a_max, out=out, **kwargs) 2038
2039
~/src/python_virtual_env/lib/python3.7/site-packages/numpy/core/fromnumeric.py in _wrapfunc(obj, method, *args, **kwds) 59
60 try: ---> 61 return bound(*args, **kwds) 62 except TypeError: 63 # A TypeError occurs if the object does have such a method in its
~/src/python_virtual_env/lib/python3.7/site-packages/numpy/core/_methods.py in _clip(a, min, max, out, casting, **kwargs) 130 else: 131 return _clip_dep_invoke_with_casting(
--> 132 um.clip, a, min, max, out=out, casting=casting, **kwargs)
133
134 def _mean(a, axis=None, dtype=None, out=None, keepdims=False):
~/src/python_virtual_env/lib/python3.7/site-packages/numpy/core/_methods.py in _clip_dep_invoke_with_casting(ufunc, out, casting, *args, **kwargs) 83 # try to deal with broken casting rules 84 try: ---> 85 return ufunc(*args, out=out, **kwargs) 86 except _exceptions._UFuncOutputCastingError as e: 87 # Numpy 1.17.0, 2019-02-24
~/src/python_virtual_env/lib/python3.7/site-packages/yt/units/yt_array.py in __array_ufunc__(self, ufunc, method, *inputs, **kwargs) 1399 raise RuntimeError(
1400 "Support for the %s ufunc with %i inputs has not been" -> 1401 "added to YTArray." % (str(ufunc), len(inputs)))
1402 if unit is None: 1403 out_arr = np.array(out_arr, copy=False)
RuntimeError : Support for the <ufunc 'clip'> ufunc with 3 inputs has not beenadded to YTArray.
<Scene Object>: Sources: source_00: <Volume Source>:YTRegion (galaxy0030): , center=[1.543e+24 1.543e+24 1.543e+24] cm, left_edge=[0. 0. 0.] cm, right_edge=[3.086e+24 3.086e+24 3.086e+24] cm transfer_function:<Color Transfer Function Object>: x_bounds:[-28, -24] nbins:256 features: ('gaussian', 'location(x):-28', 'width(x):0.01', 'height(y):(0.43, 0.024, 0.047, 0.001)') ('gaussian', 'location(x):-27', 'width(x):0.01', 'height(y):(0.34, 0.34, 0.68, 0.01)') ('gaussian', 'location(x):-25', 'width(x):0.01', 'height(y):(0.66, 0.66, 0.32, 0.1)') ('gaussian', 'location(x):-24', 'width(x):0.01', 'height(y):(0.98, 0.98, 0.91, 1)')
Camera: <Camera Object>: position:[1. 1. 1.] code_length focus:[0.5 0.5 0.5] code_length north_vector:[ 0.81649658 -0.40824829 -0.40824829] dimensionless width:[0.01999791 0.01999791 0.01999791] unitary light:None resolution:(512, 512) Lens: <Lens Object>: lens_type:plane-parallel viewpoint:[-11545.30474893 -11545.30474893 -11545.30474893] code_length _______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
_______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
This is it: https://github.com/numpy/numpy/blob/master/doc/release/1.17.0-notes.rst#clip...
On Aug 5, 2019, at 4:24 PM, John ZuHone <jzuhone@gmail.com> wrote:
I think this is a thing related to NumPy 1.17, since we’re getting Appveyor test failures related to this.
On Aug 5, 2019, at 11:56 AM, Matthew Turk <matthewturk@gmail.com> wrote:
Hi Christoph,
THis looks like a definite error in yt -- can you file a bug and I'll address it?
On Sat, Aug 3, 2019 at 3:52 PM Christoph Schaefer <cm.schaefer@gmail.com> wrote:
Hi yt-users,
I’ve wanted to have a look into the volume rendering examples. However, when I run the following code from the examples (https://yt-project.org/doc/quickstart/volume_rendering.html)
import yt
ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030") sc = yt.create_scene(ds)
sc.camera.set_width(ds.quan(20, 'kpc'))
source = sc.sources['source_00']
tf = yt.ColorTransferFunction((-28, -24)) tf.add_layers(4, w=0.01)
source.set_transfer_function(tf)
sc.show()
I get the following (error) output: (full output, see below)
: Support for the <ufunc 'clip'> ufunc with 3 inputs has not beenadded to YTArray.
Am I missing something?
installation is yt 3.5.1 numpy 1.17. matplotlib 3.1.1
Thanks for any help
Christoph
--------------------------------------------------------------------------- RuntimeError Traceback (most recent call last)
~/src/python_virtual_env/lib/python3.7/site-packages/IPython/core/formatters.py in __call__(self, obj) 343 method = get_real_method(obj, self.print_method) 344 if method is not None: --> 345 return method() 346 return None 347 else:
~/src/python_virtual_env/lib/python3.7/site-packages/yt/visualization/volume_rendering/scene.py in _repr_png_(self) 926 png = self._last_render.write_png(filename=None,
927 sigma_clip=self._sigma_clip, --> 928 background='black')
929 self._sigma_clip = None 930 return png
~/src/python_virtual_env/lib/python3.7/site-packages/yt/data_objects/image_array.py in write_png(self, filename, sigma_clip, background, rescale, clip_ratio) 287 """
288 if rescale: --> 289 scaled = self.rescale(inline=False) 290 else: 291 scaled = self
~/src/python_virtual_env/lib/python3.7/site-packages/yt/data_objects/image_array.py in rescale(self, cmax, amax, inline) 240 np.multiply(self[:, :, 3], 1.0/amax, out[:, :, 3]) 241
--> 242 np.clip(out, 0.0, 1.0, out) 243 return out
244
<__array_function__ internals> in clip(*args, **kwargs)
~/src/python_virtual_env/lib/python3.7/site-packages/numpy/core/fromnumeric.py in clip(a, a_min, a_max, out, **kwargs) 2035
2036 """
-> 2037 return _wrapfunc(a, 'clip', a_min, a_max, out=out, **kwargs) 2038
2039
~/src/python_virtual_env/lib/python3.7/site-packages/numpy/core/fromnumeric.py in _wrapfunc(obj, method, *args, **kwds) 59
60 try: ---> 61 return bound(*args, **kwds) 62 except TypeError: 63 # A TypeError occurs if the object does have such a method in its
~/src/python_virtual_env/lib/python3.7/site-packages/numpy/core/_methods.py in _clip(a, min, max, out, casting, **kwargs) 130 else: 131 return _clip_dep_invoke_with_casting(
--> 132 um.clip, a, min, max, out=out, casting=casting, **kwargs)
133
134 def _mean(a, axis=None, dtype=None, out=None, keepdims=False):
~/src/python_virtual_env/lib/python3.7/site-packages/numpy/core/_methods.py in _clip_dep_invoke_with_casting(ufunc, out, casting, *args, **kwargs) 83 # try to deal with broken casting rules 84 try: ---> 85 return ufunc(*args, out=out, **kwargs) 86 except _exceptions._UFuncOutputCastingError as e: 87 # Numpy 1.17.0, 2019-02-24
~/src/python_virtual_env/lib/python3.7/site-packages/yt/units/yt_array.py in __array_ufunc__(self, ufunc, method, *inputs, **kwargs) 1399 raise RuntimeError(
1400 "Support for the %s ufunc with %i inputs has not been" -> 1401 "added to YTArray." % (str(ufunc), len(inputs)))
1402 if unit is None: 1403 out_arr = np.array(out_arr, copy=False)
RuntimeError : Support for the <ufunc 'clip'> ufunc with 3 inputs has not beenadded to YTArray.
<Scene Object>: Sources: source_00: <Volume Source>:YTRegion (galaxy0030): , center=[1.543e+24 1.543e+24 1.543e+24] cm, left_edge=[0. 0. 0.] cm, right_edge=[3.086e+24 3.086e+24 3.086e+24] cm transfer_function:<Color Transfer Function Object>: x_bounds:[-28, -24] nbins:256 features: ('gaussian', 'location(x):-28', 'width(x):0.01', 'height(y):(0.43, 0.024, 0.047, 0.001)') ('gaussian', 'location(x):-27', 'width(x):0.01', 'height(y):(0.34, 0.34, 0.68, 0.01)') ('gaussian', 'location(x):-25', 'width(x):0.01', 'height(y):(0.66, 0.66, 0.32, 0.1)') ('gaussian', 'location(x):-24', 'width(x):0.01', 'height(y):(0.98, 0.98, 0.91, 1)')
Camera: <Camera Object>: position:[1. 1. 1.] code_length focus:[0.5 0.5 0.5] code_length north_vector:[ 0.81649658 -0.40824829 -0.40824829] dimensionless width:[0.01999791 0.01999791 0.01999791] unitary light:None resolution:(512, 512) Lens: <Lens Object>: lens_type:plane-parallel viewpoint:[-11545.30474893 -11545.30474893 -11545.30474893] code_length _______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
_______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
Hi Matthew, thanks for looking into it, I’ve opened bug #2313 Cheers Christoph
On 5. Aug 2019, at 17:56, Matthew Turk <matthewturk@gmail.com> wrote:
Hi Christoph,
THis looks like a definite error in yt -- can you file a bug and I'll address it?
On Sat, Aug 3, 2019 at 3:52 PM Christoph Schaefer <cm.schaefer@gmail.com> wrote:
Hi yt-users,
I’ve wanted to have a look into the volume rendering examples. However, when I run the following code from the examples (https://yt-project.org/doc/quickstart/volume_rendering.html)
import yt
ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030") sc = yt.create_scene(ds)
sc.camera.set_width(ds.quan(20, 'kpc'))
source = sc.sources['source_00']
tf = yt.ColorTransferFunction((-28, -24)) tf.add_layers(4, w=0.01)
source.set_transfer_function(tf)
sc.show()
I get the following (error) output: (full output, see below)
: Support for the <ufunc 'clip'> ufunc with 3 inputs has not beenadded to YTArray.
Am I missing something?
installation is yt 3.5.1 numpy 1.17. matplotlib 3.1.1
Thanks for any help
Christoph
--------------------------------------------------------------------------- RuntimeError Traceback (most recent call last)
~/src/python_virtual_env/lib/python3.7/site-packages/IPython/core/formatters.py in __call__(self, obj) 343 method = get_real_method(obj, self.print_method) 344 if method is not None: --> 345 return method() 346 return None 347 else:
~/src/python_virtual_env/lib/python3.7/site-packages/yt/visualization/volume_rendering/scene.py in _repr_png_(self) 926 png = self._last_render.write_png(filename=None,
927 sigma_clip=self._sigma_clip, --> 928 background='black')
929 self._sigma_clip = None 930 return png
~/src/python_virtual_env/lib/python3.7/site-packages/yt/data_objects/image_array.py in write_png(self, filename, sigma_clip, background, rescale, clip_ratio) 287 """
288 if rescale: --> 289 scaled = self.rescale(inline=False) 290 else: 291 scaled = self
~/src/python_virtual_env/lib/python3.7/site-packages/yt/data_objects/image_array.py in rescale(self, cmax, amax, inline) 240 np.multiply(self[:, :, 3], 1.0/amax, out[:, :, 3]) 241
--> 242 np.clip(out, 0.0, 1.0, out) 243 return out
244
<__array_function__ internals> in clip(*args, **kwargs)
~/src/python_virtual_env/lib/python3.7/site-packages/numpy/core/fromnumeric.py in clip(a, a_min, a_max, out, **kwargs) 2035
2036 """
-> 2037 return _wrapfunc(a, 'clip', a_min, a_max, out=out, **kwargs) 2038
2039
~/src/python_virtual_env/lib/python3.7/site-packages/numpy/core/fromnumeric.py in _wrapfunc(obj, method, *args, **kwds) 59
60 try: ---> 61 return bound(*args, **kwds) 62 except TypeError: 63 # A TypeError occurs if the object does have such a method in its
~/src/python_virtual_env/lib/python3.7/site-packages/numpy/core/_methods.py in _clip(a, min, max, out, casting, **kwargs) 130 else: 131 return _clip_dep_invoke_with_casting(
--> 132 um.clip, a, min, max, out=out, casting=casting, **kwargs)
133
134 def _mean(a, axis=None, dtype=None, out=None, keepdims=False):
~/src/python_virtual_env/lib/python3.7/site-packages/numpy/core/_methods.py in _clip_dep_invoke_with_casting(ufunc, out, casting, *args, **kwargs) 83 # try to deal with broken casting rules 84 try: ---> 85 return ufunc(*args, out=out, **kwargs) 86 except _exceptions._UFuncOutputCastingError as e: 87 # Numpy 1.17.0, 2019-02-24
~/src/python_virtual_env/lib/python3.7/site-packages/yt/units/yt_array.py in __array_ufunc__(self, ufunc, method, *inputs, **kwargs) 1399 raise RuntimeError(
1400 "Support for the %s ufunc with %i inputs has not been" -> 1401 "added to YTArray." % (str(ufunc), len(inputs)))
1402 if unit is None: 1403 out_arr = np.array(out_arr, copy=False)
RuntimeError : Support for the <ufunc 'clip'> ufunc with 3 inputs has not beenadded to YTArray.
<Scene Object>: Sources: source_00: <Volume Source>:YTRegion (galaxy0030): , center=[1.543e+24 1.543e+24 1.543e+24] cm, left_edge=[0. 0. 0.] cm, right_edge=[3.086e+24 3.086e+24 3.086e+24] cm transfer_function:<Color Transfer Function Object>: x_bounds:[-28, -24] nbins:256 features: ('gaussian', 'location(x):-28', 'width(x):0.01', 'height(y):(0.43, 0.024, 0.047, 0.001)') ('gaussian', 'location(x):-27', 'width(x):0.01', 'height(y):(0.34, 0.34, 0.68, 0.01)') ('gaussian', 'location(x):-25', 'width(x):0.01', 'height(y):(0.66, 0.66, 0.32, 0.1)') ('gaussian', 'location(x):-24', 'width(x):0.01', 'height(y):(0.98, 0.98, 0.91, 1)')
Camera: <Camera Object>: position:[1. 1. 1.] code_length focus:[0.5 0.5 0.5] code_length north_vector:[ 0.81649658 -0.40824829 -0.40824829] dimensionless width:[0.01999791 0.01999791 0.01999791] unitary light:None resolution:(512, 512) Lens: <Lens Object>: lens_type:plane-parallel viewpoint:[-11545.30474893 -11545.30474893 -11545.30474893] code_length _______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
_______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
participants (3)
-
Christoph Schaefer
-
John ZuHone
-
Matthew Turk