<div dir="ltr">Hey,<div><br></div><div>The issue you're having is because you're constructing known_other_fields dynamically. All the other frontends define it statically, so it's filled out by the time it's needed in the `setup_fluid_aliases` function defined in in yt/fields/field_info_container.py. The fix is to change the order of operations - setup known_other_fields and known_particle_fields before calling the __init__ method on the superclass of OpenPMDFieldInfo.</div><div><br></div><div>You're also incorrectly setting the units of the field to a Unit object --- the unit entry in the known_other_fields tuple should be a string.</div><div><br></div><div>The following diff allows me to set the units properly for your frontend:</div><div><br></div><div><a href="http://paste.yt-project.org/show/6606/">http://paste.yt-project.org/show/6606/</a><br></div><div><br></div><div>Out of curiosity - why build the known_other_fields and known_particle_fields tuples dynamically? The reason they're static for all the other frotends is to make it easy to reason about which fields are associated with a given frontend and so that the fields known by a given frontend are independent of any particular dataset you might be looking at.</div><div><br></div><div>By the way, it also looks like the 'all' particle union is working correctly - are you still having issues with that?</div><div><br></div><div>-Nathan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 10, 2016 at 8:24 AM, Fabian Koller <span dir="ltr"><<a href="mailto:f.koller@hzdr.de" target="_blank">f.koller@hzdr.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Cheers Nathan,<br>
<br>
thank you for the patch. I pulled the code (#2213) into my local copy<br>
and gave it as in-depth a test as I could. It works, except for one detail.<br>
<br>
I am unsure whether the problem arises from the frontend or through the<br>
unit system, but what I am currently facing is: fields from<br>
known_other_fields do not have units (ergo are dimensionless) in<br>
datasets, no matter what the unit in known_other_fields.<br>
<br>
I've attached a script which tries to show the problem by using one of<br>
the example files Axel linked to in his last mail.<br>
<br>
<br>
--Fabian<br>
<span class=""><br>
<br>
On 03/06/16 23:05, Nathan Goldbaum wrote:<br>
> I've opened a pull request to fix the issue you discovered with<br>
> magnetic units:<br>
><br>
> <a href="https://bitbucket.org/yt_analysis/yt/pull-requests/2213" rel="noreferrer" target="_blank">https://bitbucket.org/yt_analysis/yt/pull-requests/2213</a><br>
><br>
> I'd appreciate it if one of you could give it a test. Let me know if<br>
> you have questions about how to pull a pull request in locally with<br>
> mercurial.<br>
><br>
> I haven't had a time to look at the issue you were having with the<br>
> 'all' particle union, but I have it on my list to look at it.<br>
><br>
> On Fri, May 27, 2016 at 2:37 AM, Huebl, Axel <<a href="mailto:a.huebl@hzdr.de">a.huebl@hzdr.de</a><br>
</span><span class="">> <mailto:<a href="mailto:a.huebl@hzdr.de">a.huebl@hzdr.de</a>>> wrote:<br>
><br>
>     Dear Nathan and John,<br>
><br>
>     thank you for the quick answers.<br>
><br>
>     Yes, the resources to reproduce the questions are:<br>
><br>
>     Repo:<br>
>       <a href="https://bitbucket.org/C0nsultant/openpmd/src?at=yt" rel="noreferrer" target="_blank">https://bitbucket.org/C0nsultant/openpmd/src?at=yt</a><br>
><br>
>     Example Files:<br>
>       PIConGPU > 2D3V > one of the .h5 files<br>
>       <a href="https://owncloud.hzdr.de/index.php/s/ouisGZe5M0wCVzj" rel="noreferrer" target="_blank">https://owncloud.hzdr.de/index.php/s/ouisGZe5M0wCVzj</a><br>
>       password: openPMD<br>
><br>
>     Example script (attached, like last mail).<br>
><br>
><br>
>     Axel<br>
><br>
</span><span class="">>     On <a href="tel:24.05.2016%2018" value="+12405201618">24.05.2016 18</a> <tel:24.05.2016%2018>:37, Nathan Goldbaum wrote:<br>
>     ><br>
>     ><br>
>     > On Tue, May 24, 2016 at 11:30 AM, Huebl, Axel <<a href="mailto:a.huebl@hzdr.de">a.huebl@hzdr.de</a><br>
>     <mailto:<a href="mailto:a.huebl@hzdr.de">a.huebl@hzdr.de</a>><br>
</span><div><div class="h5">>     > <mailto:<a href="mailto:a.huebl@hzdr.de">a.huebl@hzdr.de</a> <mailto:<a href="mailto:a.huebl@hzdr.de">a.huebl@hzdr.de</a>>>> wrote:<br>
>     ><br>
>     >     Hi yt-devs,<br>
>     ><br>
>     >     I am forwarding this conversation to the public list to keep<br>
>     it open for<br>
>     >     others to join in and to build up a record that might help<br>
>     others.<br>
>     ><br>
>     >     Our new student Fabian updated our frontend and implemented<br>
>     particle<br>
>     >     readers. Unfortunately some details of the particle "fields"<br>
>     still cause<br>
>     >     some bumps that we can not get our head around.<br>
>     ><br>
>     >     We are now able to read fields and particles, even<br>
>     chunk-wise, and can<br>
>     >     work with the data we read in python scripts via the<br>
>     all_data() method.<br>
>     ><br>
>     >     Nevertheless, using the particle scatter plots such as<br>
>     yt.ParticlePlot<br>
>     >     seems not to work. We have some problems with unions / the<br>
>     "all" group<br>
>     >     and the fact that we have several particle species (e.g., "hot<br>
>     >     electrons", "cold electrons", "helium ions", "nitrogen<br>
>     ions", etc.)<br>
>     ><br>
>     ><br>
>     > The 'all' particle union should get set up automatically, but maybe<br>
>     > something is going wrong with that machinery.<br>
>     ><br>
>     > Can you create a test script that illustrates this issue using a<br>
>     > publicly available OpenPMD dataset?<br>
>     ><br>
>     ><br>
>     ><br>
>     >     Also since the last rebase: did someone recently change the<br>
>     unit system<br>
>     >     in yt? T for "Tesla" seems not to be understood any more. Is<br>
>     there a<br>
>     >     changelog somewhere available? Do we have to describe our<br>
>     data in<br>
>     >     cgs / mks?<br>
>     ><br>
>     ><br>
>     > I just double-checked, and Tesla should be working:<br>
>     ><br>
>     > In [1]: from yt import YTQuantity<br>
>     ><br>
>     > In [2]: YTQuantity(1, 'T')<br>
>     > Out[2]: 1.0 T<br>
>     ><br>
>     > In [3]: YTQuantity(1, 'T').to_equivalent('G', 'CGS')<br>
>     > Out[3]: 10000.0 G<br>
>     ><br>
>     > Can you explain a little bit more what issue you're having? A test<br>
>     > script that illustrates the issue would also help.<br>
>     ><br>
>     ><br>
>     >     Would someone be interested for a quick heads up via e.g.,<br>
>     skype /<br>
>     >     web-rtc so we can ask specific questions?<br>
>     ><br>
>     >     Fabian is around on Tuesdays and Fridays, something like<br>
>     early CA time,<br>
>     >     and late GER time usually works great (e.g., 9pm-PDT /<br>
>     6pm-CEST).<br>
>     ><br>
>     >     Our current branch HEAD can be found here<br>
>     (->yt->frontends->openPMD):<br>
>     >       <a href="https://bitbucket.org/C0nsultant/openpmd/src?at=yt" rel="noreferrer" target="_blank">https://bitbucket.org/C0nsultant/openpmd/src?at=yt</a><br>
>     ><br>
>     >     And an example script is attached.<br>
>     ><br>
>     ><br>
>     >     Thanks a lot!<br>
>     >     Axel<br>
>     ><br>
>     ><br>
><br>
>     --<br>
><br>
>     Axel Huebl<br>
</div></div>>     Phone <a href="tel:%2B49%20351%20260%203582" value="+493512603582">+49 351 260 3582</a> <tel:%2B49%20351%20260%203582><br>
<span class="">>     <a href="https://www.hzdr.de/crp" rel="noreferrer" target="_blank">https://www.hzdr.de/crp</a><br>
>     Computational Radiation Physics<br>
>     Laser Particle Acceleration Division<br>
>     Helmholtz-Zentrum Dresden - Rossendorf e.V.<br>
><br>
>     Bautzner Landstrasse 400, 01328 Dresden<br>
>     POB 510119, D-01314 Dresden<br>
>     Vorstand: Prof. Dr.Dr.h.c. R. Sauerbrey<br>
>               Prof. Dr.Dr.h.c. P. Joehnk<br>
>     VR 1693 beim Amtsgericht Dresden<br>
><br>
>     _______________________________________________<br>
>     yt-dev mailing list<br>
</span>>     <a href="mailto:yt-dev@lists.spacepope.org">yt-dev@lists.spacepope.org</a> <mailto:<a href="mailto:yt-dev@lists.spacepope.org">yt-dev@lists.spacepope.org</a>><br>
>     <a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a><br>
<div class="HOEnZb"><div class="h5">><br>
><br>
><br>
><br>
> _______________________________________________<br>
> yt-dev mailing list<br>
> <a href="mailto:yt-dev@lists.spacepope.org">yt-dev@lists.spacepope.org</a><br>
> <a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a><br>
<br>
</div></div><br>_______________________________________________<br>
yt-dev mailing list<br>
<a href="mailto:yt-dev@lists.spacepope.org">yt-dev@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a><br>
<br></blockquote></div><br></div>