[yt-users] problem with 0D point object
Nathan Goldbaum
nathan12343 at gmail.com
Tue Feb 16 09:50:30 PST 2016
Hi Juan,
This is exactly the error I fixed in my open pull request. That bugfix will
hopefully be merged in within the next week or so.
-Nathan
On Tue, Feb 16, 2016 at 11:04 AM, Juan Camilo Ibanez Mejia <
jibanezmejia at amnh.org> wrote:
> Hi Nathan,
>
> I was using yt 3.0, but even if I use 3.2.2 I get the same error.
> First of all I try to use the position as *[100, 0 , 0]*pc* I get the
> following error:
>
> ---------------------------------------------------------------------------
>
> UnitParseError Traceback (most recent call last)
>
> <ipython-input-10-b04e5f0e91ef> in <module>() 2 3 point1 = pf.point([100, 0, 0]*pc)----> 4 print ("point 1 is at x=", point1["x"].in_units("pc"))
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py in __getitem__(self, key) 251 return self.field_data[f] 252 else:--> 253 self.get_data(f) 254 # fi.units is the unit expression string. We depend on the registry 255 # hanging off the dataset to define this unit object.
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py in get_data(self, fields) 641 def get_data(self, fields=None): 642 if self._current_chunk is None:--> 643 self.index._identify_base_chunk(self) 644 if fields is None: return 645 nfields = []
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/geometry/grid_geometry_handler.py in _identify_base_chunk(self, dobj) 289 def _identify_base_chunk(self, dobj): 290 fast_index = None--> 291 def _gsort(g): 292 if g.filename is None: 293 return g.id
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py in selector(self) 602 self._selector = compose_selector(self, self._data_source.selector, sclass(self)) 603 else:--> 604 self._selector = sclass(self) 605 return self._selector 606
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/geometry/selection_routines.cpython-34m.so in yt.geometry.selection_routines.PointSelector.__init__ (yt/geometry/selection_routines.c:13208)()
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/geometry/selection_routines.cpython-34m.so in yt.geometry.selection_routines._ensure_code (yt/geometry/selection_routines.c:30119)()
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/yt_array.py in convert_to_units(self, units) 396 397 """--> 398 new_units = self._unit_repr_check_same(units) 399 (conversion_factor, offset) = self.units.get_conversion_factor(new_units) 400
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/yt_array.py in _unit_repr_check_same(self, units) 370 # let Unit() handle units arg if it's not already a Unit obj. 371 if not isinstance(units, Unit):--> 372 units = Unit(units, registry=self.units.registry) 373 374 equiv_dims = em_dimensions.get(self.units.dimensions,None)
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in __new__(cls, unit_expr, base_value, base_offset, dimensions, registry, **assumptions) 202 % (base_value, type(base_value)) ) 203 --> 204 # check that dimensions is valid 205 if dimensions is not None: 206 validate_dimensions(dimensions)
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in _get_unit_data_from_expr(unit_expr, unit_symbol_lut) 482 """ 483 # The simplest case first--> 484 if isinstance(unit_expr, Unit): 485 return (unit_expr.base_value, unit_expr.dimensions) 486
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in _lookup_unit_symbol(symbol_str, unit_symbol_lut) 553 '{'+symbol_wo_prefix+'}', '{'+sstr+'}') 554 --> 555 # don't forget to account for the prefix value! 556 return (unit_data[0] * prefix_value, unit_data[1]) 557
> UnitParseError: Could not find unit symbol 'code_length' in the provided symbols.
>
> 2
>
> 3 point1 = pf.point([100, 0, 0]*pc)
>
> ----> 4 print ("point 1 is at x=", point1["x"].in_units("pc"))
>
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py in __getitem__(self, key) 251 return self.field_data[f] 252 else:--> 253 self.get_data(f) 254 # fi.units is the unit expression string. We depend on the registry 255 # hanging off the dataset to define this unit object.
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py in get_data(self, fields) 641 def get_data(self, fields=None): 642 if self._current_chunk is None:--> 643 self.index._identify_base_chunk(self) 644 if fields is None: return 645 nfields = []
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/geometry/grid_geometry_handler.py in _identify_base_chunk(self, dobj) 289 def _identify_base_chunk(self, dobj): 290 fast_index = None--> 291 def _gsort(g): 292 if g.filename is None: 293 return g.id
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py in selector(self) 602 self._selector = compose_selector(self, self._data_source.selector, sclass(self)) 603 else:--> 604 self._selector = sclass(self) 605 return self._selector 606
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/geometry/selection_routines.cpython-34m.so in yt.geometry.selection_routines.PointSelector.__init__ (yt/geometry/selection_routines.c:13208)()
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/geometry/selection_routines.cpython-34m.so in yt.geometry.selection_routines._ensure_code (yt/geometry/selection_routines.c:30119)()
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/yt_array.py in convert_to_units(self, units) 396 397 """--> 398 new_units = self._unit_repr_check_same(units) 399 (conversion_factor, offset) = self.units.get_conversion_factor(new_units) 400
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/yt_array.py in _unit_repr_check_same(self, units) 370 # let Unit() handle units arg if it's not already a Unit obj. 371 if not isinstance(units, Unit):--> 372 units = Unit(units, registry=self.units.registry) 373 374 equiv_dims = em_dimensions.get(self.units.dimensions,None)
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in __new__(cls, unit_expr, base_value, base_offset, dimensions, registry, **assumptions) 202 % (base_value, type(base_value)) ) 203 --> 204 # check that dimensions is valid 205 if dimensions is not None: 206 validate_dimensions(dimensions)
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in _get_unit_data_from_expr(unit_expr, unit_symbol_lut) 482 """ 483 # The simplest case first--> 484 if isinstance(unit_expr, Unit): 485 return (unit_expr.base_value, unit_expr.dimensions) 486
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in _lookup_unit_symbol(symbol_str, unit_symbol_lut) 553 '{'+symbol_wo_prefix+'}', '{'+sstr+'}') 554 --> 555 # don't forget to account for the prefix value! 556 return (unit_data[0] * prefix_value, unit_data[1]) 557
> UnitParseError: Could not find unit symbol 'code_length' in the provided symbols.
>
> 251 return self.field_data[f]
>
> 252 else:
>
> --> 253 self.get_data(f)
>
> 254 # fi.units is the unit expression string. We depend on the registry
>
> 255 # hanging off the dataset to define this unit object.
>
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py in get_data(self, fields) 641 def get_data(self, fields=None): 642 if self._current_chunk is None:--> 643 self.index._identify_base_chunk(self) 644 if fields is None: return 645 nfields = []
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/geometry/grid_geometry_handler.py in _identify_base_chunk(self, dobj) 289 def _identify_base_chunk(self, dobj): 290 fast_index = None--> 291 def _gsort(g): 292 if g.filename is None: 293 return g.id
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py in selector(self) 602 self._selector = compose_selector(self, self._data_source.selector, sclass(self)) 603 else:--> 604 self._selector = sclass(self) 605 return self._selector 606
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/geometry/selection_routines.cpython-34m.so in yt.geometry.selection_routines.PointSelector.__init__ (yt/geometry/selection_routines.c:13208)()
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/geometry/selection_routines.cpython-34m.so in yt.geometry.selection_routines._ensure_code (yt/geometry/selection_routines.c:30119)()
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/yt_array.py in convert_to_units(self, units) 396 397 """--> 398 new_units = self._unit_repr_check_same(units) 399 (conversion_factor, offset) = self.units.get_conversion_factor(new_units) 400
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/yt_array.py in _unit_repr_check_same(self, units) 370 # let Unit() handle units arg if it's not already a Unit obj. 371 if not isinstance(units, Unit):--> 372 units = Unit(units, registry=self.units.registry) 373 374 equiv_dims = em_dimensions.get(self.units.dimensions,None)
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in __new__(cls, unit_expr, base_value, base_offset, dimensions, registry, **assumptions) 202 % (base_value, type(base_value)) ) 203 --> 204 # check that dimensions is valid 205 if dimensions is not None: 206 validate_dimensions(dimensions)
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in _get_unit_data_from_expr(unit_expr, unit_symbol_lut) 482 """ 483 # The simplest case first--> 484 if isinstance(unit_expr, Unit): 485 return (unit_expr.base_value, unit_expr.dimensions) 486
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in _lookup_unit_symbol(symbol_str, unit_symbol_lut) 553 '{'+symbol_wo_prefix+'}', '{'+sstr+'}') 554 --> 555 # don't forget to account for the prefix value! 556 return (unit_data[0] * prefix_value, unit_data[1]) 557
> UnitParseError: Could not find unit symbol 'code_length' in the provided symbols.
>
> 641 def get_data(self, fields=None):
>
> 642 if self._current_chunk is None:
>
> --> 643 self.index._identify_base_chunk(self)
>
> 644 if fields is None: return
>
> 645 nfields = []
>
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/geometry/grid_geometry_handler.py in _identify_base_chunk(self, dobj) 289 def _identify_base_chunk(self, dobj): 290 fast_index = None--> 291 def _gsort(g): 292 if g.filename is None: 293 return g.id
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py in selector(self) 602 self._selector = compose_selector(self, self._data_source.selector, sclass(self)) 603 else:--> 604 self._selector = sclass(self) 605 return self._selector 606
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/geometry/selection_routines.cpython-34m.so in yt.geometry.selection_routines.PointSelector.__init__ (yt/geometry/selection_routines.c:13208)()
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/geometry/selection_routines.cpython-34m.so in yt.geometry.selection_routines._ensure_code (yt/geometry/selection_routines.c:30119)()
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/yt_array.py in convert_to_units(self, units) 396 397 """--> 398 new_units = self._unit_repr_check_same(units) 399 (conversion_factor, offset) = self.units.get_conversion_factor(new_units) 400
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/yt_array.py in _unit_repr_check_same(self, units) 370 # let Unit() handle units arg if it's not already a Unit obj. 371 if not isinstance(units, Unit):--> 372 units = Unit(units, registry=self.units.registry) 373 374 equiv_dims = em_dimensions.get(self.units.dimensions,None)
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in __new__(cls, unit_expr, base_value, base_offset, dimensions, registry, **assumptions) 202 % (base_value, type(base_value)) ) 203 --> 204 # check that dimensions is valid 205 if dimensions is not None: 206 validate_dimensions(dimensions)
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in _get_unit_data_from_expr(unit_expr, unit_symbol_lut) 482 """ 483 # The simplest case first--> 484 if isinstance(unit_expr, Unit): 485 return (unit_expr.base_value, unit_expr.dimensions) 486
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in _lookup_unit_symbol(symbol_str, unit_symbol_lut) 553 '{'+symbol_wo_prefix+'}', '{'+sstr+'}') 554 --> 555 # don't forget to account for the prefix value! 556 return (unit_data[0] * prefix_value, unit_data[1]) 557
> UnitParseError: Could not find unit symbol 'code_length' in the provided symbols.
>
> 289 def _identify_base_chunk(self, dobj):
>
> 290 fast_index = None
>
> --> 291 def _gsort(g): 292 if g.filename is None: 293 return g.id
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py in selector(self) 602 self._selector = compose_selector(self, self._data_source.selector, sclass(self)) 603 else:--> 604 self._selector = sclass(self) 605 return self._selector 606
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/geometry/selection_routines.cpython-34m.so in yt.geometry.selection_routines.PointSelector.__init__ (yt/geometry/selection_routines.c:13208)()
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/geometry/selection_routines.cpython-34m.so in yt.geometry.selection_routines._ensure_code (yt/geometry/selection_routines.c:30119)()
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/yt_array.py in convert_to_units(self, units) 396 397 """--> 398 new_units = self._unit_repr_check_same(units) 399 (conversion_factor, offset) = self.units.get_conversion_factor(new_units) 400
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/yt_array.py in _unit_repr_check_same(self, units) 370 # let Unit() handle units arg if it's not already a Unit obj. 371 if not isinstance(units, Unit):--> 372 units = Unit(units, registry=self.units.registry) 373 374 equiv_dims = em_dimensions.get(self.units.dimensions,None)
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in __new__(cls, unit_expr, base_value, base_offset, dimensions, registry, **assumptions) 202 % (base_value, type(base_value)) ) 203 --> 204 # check that dimensions is valid 205 if dimensions is not None: 206 validate_dimensions(dimensions)
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in _get_unit_data_from_expr(unit_expr, unit_symbol_lut) 482 """ 483 # The simplest case first--> 484 if isinstance(unit_expr, Unit): 485 return (unit_expr.base_value, unit_expr.dimensions) 486
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in _lookup_unit_symbol(symbol_str, unit_symbol_lut) 553 '{'+symbol_wo_prefix+'}', '{'+sstr+'}') 554 --> 555 # don't forget to account for the prefix value! 556 return (unit_data[0] * prefix_value, unit_data[1]) 557
> UnitParseError: Could not find unit symbol 'code_length' in the provided symbols.
>
> 292 if g.filename is None:
>
> 293 return g.id
>
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py in selector(self) 602 self._selector = compose_selector(self, self._data_source.selector, sclass(self)) 603 else:--> 604 self._selector = sclass(self) 605 return self._selector 606
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/geometry/selection_routines.cpython-34m.so in yt.geometry.selection_routines.PointSelector.__init__ (yt/geometry/selection_routines.c:13208)()
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/geometry/selection_routines.cpython-34m.so in yt.geometry.selection_routines._ensure_code (yt/geometry/selection_routines.c:30119)()
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/yt_array.py in convert_to_units(self, units) 396 397 """--> 398 new_units = self._unit_repr_check_same(units) 399 (conversion_factor, offset) = self.units.get_conversion_factor(new_units) 400
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/yt_array.py in _unit_repr_check_same(self, units) 370 # let Unit() handle units arg if it's not already a Unit obj. 371 if not isinstance(units, Unit):--> 372 units = Unit(units, registry=self.units.registry) 373 374 equiv_dims = em_dimensions.get(self.units.dimensions,None)
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in __new__(cls, unit_expr, base_value, base_offset, dimensions, registry, **assumptions) 202 % (base_value, type(base_value)) ) 203 --> 204 # check that dimensions is valid 205 if dimensions is not None: 206 validate_dimensions(dimensions)
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in _get_unit_data_from_expr(unit_expr, unit_symbol_lut) 482 """ 483 # The simplest case first--> 484 if isinstance(unit_expr, Unit): 485 return (unit_expr.base_value, unit_expr.dimensions) 486
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in _lookup_unit_symbol(symbol_str, unit_symbol_lut) 553 '{'+symbol_wo_prefix+'}', '{'+sstr+'}') 554 --> 555 # don't forget to account for the prefix value! 556 return (unit_data[0] * prefix_value, unit_data[1]) 557
> UnitParseError: Could not find unit symbol 'code_length' in the provided symbols.
>
> 602 self._selector = compose_selector(self, self._data_source.selector, sclass(self))
>
> 603 else:
>
> --> 604 self._selector = sclass(self)
>
> 605 return self._selector
>
> 606
>
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/geometry/selection_routines.cpython-34m.so in yt.geometry.selection_routines.PointSelector.__init__ (yt/geometry/selection_routines.c:13208)()
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/geometry/selection_routines.cpython-34m.so in yt.geometry.selection_routines._ensure_code (yt/geometry/selection_routines.c:30119)()
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/yt_array.py in convert_to_units(self, units) 396 397 """--> 398 new_units = self._unit_repr_check_same(units) 399 (conversion_factor, offset) = self.units.get_conversion_factor(new_units) 400
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/yt_array.py in _unit_repr_check_same(self, units) 370 # let Unit() handle units arg if it's not already a Unit obj. 371 if not isinstance(units, Unit):--> 372 units = Unit(units, registry=self.units.registry) 373 374 equiv_dims = em_dimensions.get(self.units.dimensions,None)
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in __new__(cls, unit_expr, base_value, base_offset, dimensions, registry, **assumptions) 202 % (base_value, type(base_value)) ) 203 --> 204 # check that dimensions is valid 205 if dimensions is not None: 206 validate_dimensions(dimensions)
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in _get_unit_data_from_expr(unit_expr, unit_symbol_lut) 482 """ 483 # The simplest case first--> 484 if isinstance(unit_expr, Unit): 485 return (unit_expr.base_value, unit_expr.dimensions) 486
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in _lookup_unit_symbol(symbol_str, unit_symbol_lut) 553 '{'+symbol_wo_prefix+'}', '{'+sstr+'}') 554 --> 555 # don't forget to account for the prefix value! 556 return (unit_data[0] * prefix_value, unit_data[1]) 557
> UnitParseError: Could not find unit symbol 'code_length' in the provided symbols.
>
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/geometry/selection_routines.cpython-34m.so in yt.geometry.selection_routines._ensure_code (yt/geometry/selection_routines.c:30119)()
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/yt_array.py in convert_to_units(self, units) 396 397 """--> 398 new_units = self._unit_repr_check_same(units) 399 (conversion_factor, offset) = self.units.get_conversion_factor(new_units) 400
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/yt_array.py in _unit_repr_check_same(self, units) 370 # let Unit() handle units arg if it's not already a Unit obj. 371 if not isinstance(units, Unit):--> 372 units = Unit(units, registry=self.units.registry) 373 374 equiv_dims = em_dimensions.get(self.units.dimensions,None)
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in __new__(cls, unit_expr, base_value, base_offset, dimensions, registry, **assumptions) 202 % (base_value, type(base_value)) ) 203 --> 204 # check that dimensions is valid 205 if dimensions is not None: 206 validate_dimensions(dimensions)
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in _get_unit_data_from_expr(unit_expr, unit_symbol_lut) 482 """ 483 # The simplest case first--> 484 if isinstance(unit_expr, Unit): 485 return (unit_expr.base_value, unit_expr.dimensions) 486
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in _lookup_unit_symbol(symbol_str, unit_symbol_lut) 553 '{'+symbol_wo_prefix+'}', '{'+sstr+'}') 554 --> 555 # don't forget to account for the prefix value! 556 return (unit_data[0] * prefix_value, unit_data[1]) 557
> UnitParseError: Could not find unit symbol 'code_length' in the provided symbols.
>
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/yt_array.py in convert_to_units(self, units) 396 397 """--> 398 new_units = self._unit_repr_check_same(units) 399 (conversion_factor, offset) = self.units.get_conversion_factor(new_units) 400
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/yt_array.py in _unit_repr_check_same(self, units) 370 # let Unit() handle units arg if it's not already a Unit obj. 371 if not isinstance(units, Unit):--> 372 units = Unit(units, registry=self.units.registry) 373 374 equiv_dims = em_dimensions.get(self.units.dimensions,None)
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in __new__(cls, unit_expr, base_value, base_offset, dimensions, registry, **assumptions) 202 % (base_value, type(base_value)) ) 203 --> 204 # check that dimensions is valid 205 if dimensions is not None: 206 validate_dimensions(dimensions)
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in _get_unit_data_from_expr(unit_expr, unit_symbol_lut) 482 """ 483 # The simplest case first--> 484 if isinstance(unit_expr, Unit): 485 return (unit_expr.base_value, unit_expr.dimensions) 486
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in _lookup_unit_symbol(symbol_str, unit_symbol_lut) 553 '{'+symbol_wo_prefix+'}', '{'+sstr+'}') 554 --> 555 # don't forget to account for the prefix value! 556 return (unit_data[0] * prefix_value, unit_data[1]) 557
> UnitParseError: Could not find unit symbol 'code_length' in the provided symbols.
>
> 396
>
> 397 """
>
> --> 398 new_units = self._unit_repr_check_same(units)
>
> 399 (conversion_factor, offset) = self.units.get_conversion_factor(new_units)
>
> 400
>
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/yt_array.py in _unit_repr_check_same(self, units) 370 # let Unit() handle units arg if it's not already a Unit obj. 371 if not isinstance(units, Unit):--> 372 units = Unit(units, registry=self.units.registry) 373 374 equiv_dims = em_dimensions.get(self.units.dimensions,None)
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in __new__(cls, unit_expr, base_value, base_offset, dimensions, registry, **assumptions) 202 % (base_value, type(base_value)) ) 203 --> 204 # check that dimensions is valid 205 if dimensions is not None: 206 validate_dimensions(dimensions)
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in _get_unit_data_from_expr(unit_expr, unit_symbol_lut) 482 """ 483 # The simplest case first--> 484 if isinstance(unit_expr, Unit): 485 return (unit_expr.base_value, unit_expr.dimensions) 486
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in _lookup_unit_symbol(symbol_str, unit_symbol_lut) 553 '{'+symbol_wo_prefix+'}', '{'+sstr+'}') 554 --> 555 # don't forget to account for the prefix value! 556 return (unit_data[0] * prefix_value, unit_data[1]) 557
> UnitParseError: Could not find unit symbol 'code_length' in the provided symbols.
>
> 370 # let Unit() handle units arg if it's not already a Unit obj.
>
> 371 if not isinstance(units, Unit):
>
> --> 372 units = Unit(units, registry=self.units.registry)
>
> 373
>
> 374 equiv_dims = em_dimensions.get(self.units.dimensions,None)
>
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in __new__(cls, unit_expr, base_value, base_offset, dimensions, registry, **assumptions) 202 % (base_value, type(base_value)) ) 203 --> 204 # check that dimensions is valid 205 if dimensions is not None: 206 validate_dimensions(dimensions)
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in _get_unit_data_from_expr(unit_expr, unit_symbol_lut) 482 """ 483 # The simplest case first--> 484 if isinstance(unit_expr, Unit): 485 return (unit_expr.base_value, unit_expr.dimensions) 486
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in _lookup_unit_symbol(symbol_str, unit_symbol_lut) 553 '{'+symbol_wo_prefix+'}', '{'+sstr+'}') 554 --> 555 # don't forget to account for the prefix value! 556 return (unit_data[0] * prefix_value, unit_data[1]) 557
> UnitParseError: Could not find unit symbol 'code_length' in the provided symbols.
>
> 202 % (base_value, type(base_value)) )
>
> 203
>
> --> 204 # check that dimensions is valid 205 if dimensions is not None: 206 validate_dimensions(dimensions)
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in _get_unit_data_from_expr(unit_expr, unit_symbol_lut) 482 """ 483 # The simplest case first--> 484 if isinstance(unit_expr, Unit): 485 return (unit_expr.base_value, unit_expr.dimensions) 486
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in _lookup_unit_symbol(symbol_str, unit_symbol_lut) 553 '{'+symbol_wo_prefix+'}', '{'+sstr+'}') 554 --> 555 # don't forget to account for the prefix value! 556 return (unit_data[0] * prefix_value, unit_data[1]) 557
> UnitParseError: Could not find unit symbol 'code_length' in the provided symbols.
>
> 205 if dimensions is not None:
>
> 206 validate_dimensions(dimensions)
>
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in _get_unit_data_from_expr(unit_expr, unit_symbol_lut) 482 """ 483 # The simplest case first--> 484 if isinstance(unit_expr, Unit): 485 return (unit_expr.base_value, unit_expr.dimensions) 486
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in _lookup_unit_symbol(symbol_str, unit_symbol_lut) 553 '{'+symbol_wo_prefix+'}', '{'+sstr+'}') 554 --> 555 # don't forget to account for the prefix value! 556 return (unit_data[0] * prefix_value, unit_data[1]) 557
> UnitParseError: Could not find unit symbol 'code_length' in the provided symbols.
>
> 482 """
>
> 483 # The simplest case first
>
> --> 484 if isinstance(unit_expr, Unit): 485 return (unit_expr.base_value, unit_expr.dimensions) 486
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in _lookup_unit_symbol(symbol_str, unit_symbol_lut) 553 '{'+symbol_wo_prefix+'}', '{'+sstr+'}') 554 --> 555 # don't forget to account for the prefix value! 556 return (unit_data[0] * prefix_value, unit_data[1]) 557
> UnitParseError: Could not find unit symbol 'code_length' in the provided symbols.
>
> 485 return (unit_expr.base_value, unit_expr.dimensions)
>
> 486
>
> /home/jcibanezm/codes/yt322/yt-x86_64/src/yt-hg/yt/units/unit_object.py in _lookup_unit_symbol(symbol_str, unit_symbol_lut) 553 '{'+symbol_wo_prefix+'}', '{'+sstr+'}') 554 --> 555 # don't forget to account for the prefix value! 556 return (unit_data[0] * prefix_value, unit_data[1]) 557
> UnitParseError: Could not find unit symbol 'code_length' in the provided symbols.
>
> 553 '{'+symbol_wo_prefix+'}', '{'+sstr+'}')
>
> 554
>
> --> 555 # don't forget to account for the prefix value! 556 return (unit_data[0] * prefix_value, unit_data[1]) 557
> UnitParseError: Could not find unit symbol 'code_length' in the provided symbols.
>
> 556 return (unit_data[0] * prefix_value, unit_data[1])
>
> 557
>
> UnitParseError: Could not find unit symbol 'code_length' in the provided symbols.
>
>
>
>
>
> On 16 Feb 2016, at 5:37 PM, Nathan Goldbaum <nathan12343 at gmail.com> wrote:
>
> Hi Juan,
>
> I'm not able to reproduce this on the development branch using this
> modified version of your script:
>
> http://paste.yt-project.org/show/6249/
>
> That said, I did need to make a modified to the point data object so it
> does a little bit more input sanitization for the point you pass it. I've
> opened a pull request with those fixes here:
>
>
> https://bitbucket.org/yt_analysis/yt/pull-requests/1991/fix-issues-with-input-sanitization-in-the/diff
>
> -Nathan
>
> On Tue, Feb 16, 2016 at 10:02 AM, Juan Camilo Ibanez Mejia <
> jibanezmejia at amnh.org> wrote:
>
>> Hi all,
>>
>> I’m having problems using the 0D point object with a Flash dataset.
>>
>> When I try to retrieve the information from a coordinate with negative x
>> or y coordinates I get an empty result.
>> An example is given in http://paste.yt-project.org/show/6247/.
>>
>> ps: My dataset goes between +-500 pc in the x and y direction, so there
>> is data there.
>>
>> Thanks for you help.
>>
>> Cheers,
>> Juan
>>
>>
>>
>>
>>
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20160216/81f64754/attachment.htm>
More information about the yt-users
mailing list