[yt-dev] Issue #1316: Unit conversion with equivalency (yt_analysis/yt)

Hsi-Yu Schive issues-reply at bitbucket.org
Wed Feb 1 17:53:27 PST 2017


New issue 1316: Unit conversion with equivalency
https://bitbucket.org/yt_analysis/yt/issues/1316/unit-conversion-with-equivalency

Hsi-Yu Schive:

The following script fails.

```
#!python

import yt
ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
slc = yt.SlicePlot(ds, 'z', 'temperature', width=(10,'kpc'))

#this line causes a problem
slc.set_buff_size(2048)

slc.set_unit('temperature', 'keV', equivalency='thermal')
slc.save()
```

Error messages:
```
#!python
yt.utilities.exceptions.YTUnitConversionError: Unit dimensionalities do not match. Tried to convert between K**2/erg (dim (temperature)**2*(time)**2/((length)**2*(mass))) and K (dim (temperature)).
```

This issue is related to pull request #2424. Note that calling set_buff_size() AFTER set_unit() does not trigger this issue.




More information about the yt-dev mailing list