Code Monkey home page Code Monkey logo

Comments (10)

atmyers avatar atmyers commented on August 22, 2024

Hi @hjjvandam, I just tried this and couldn't reproduce the error with my version of yt. What is the output of the yt version command for you? Also, if you go to the yt source code, what is the git hash of the code you built?

Thanks,
Andrew

from exaepi.

hjjvandam avatar hjjvandam commented on August 22, 2024

Hi @atmyers,
Thanks for looking into this. Running "yt version" gives "Version = 4.3.0".
Running "git rev-parse --short HEAD" in the "yt" repo gives "e8d92aeb8".
Huub

from exaepi.

atmyers avatar atmyers commented on August 22, 2024

Oh, I see the issue. The version is fine, but could you try running it one directory back, so that plt00000 is in the directory you run plot.py from?

from exaepi.

hjjvandam avatar hjjvandam commented on August 22, 2024

from exaepi.

atmyers avatar atmyers commented on August 22, 2024

You should run it one directory back from that, so from /home/hvandam/Documents/AMReX/ExaEpi/examples/test-pbar+1/ in the above example.

from exaepi.

hjjvandam avatar hjjvandam commented on August 22, 2024

OK, unfortunately that doesn't change much:

(pyamrex) [hvandam@lpo-170127 test-pbar+1]$ python ../../etc/plot.py plt00000
yt : [INFO     ] 2023-12-20 22:13:37,759 Parameters: current_time              = 0.0
yt : [INFO     ] 2023-12-20 22:13:37,759 Parameters: domain_dimensions         = [150 149   1]
yt : [INFO     ] 2023-12-20 22:13:37,759 Parameters: domain_left_edge          = [0. 0. 0.]
yt : [INFO     ] 2023-12-20 22:13:37,759 Parameters: domain_right_edge         = [1. 1. 1.]
Traceback (most recent call last):
  File "/home/hvandam/Documents/AMReX/ExaEpi/examples/test-pbar+1/../../etc/plot.py", line 10, in <module>
    ad = ds.all_data()
         ^^^^^^^^^^^^^
  File "/home/hvandam/pyamrex/lib64/python3.11/site-packages/yt/data_objects/static_output.py", line 1194, in all_data
    self.index
  File "/home/hvandam/pyamrex/lib64/python3.11/site-packages/yt/data_objects/static_output.py", line 606, in index
    self._instantiated_index = self._index_class(
                               ^^^^^^^^^^^^^^^^^^
  File "/home/hvandam/pyamrex/lib64/python3.11/site-packages/yt/frontends/boxlib/data_structures.py", line 926, in __init__
    super().__init__(ds, dataset_type)
  File "/home/hvandam/pyamrex/lib64/python3.11/site-packages/yt/frontends/boxlib/data_structures.py", line 345, in __init__
    GridIndex.__init__(self, ds, dataset_type)
  File "/home/hvandam/pyamrex/lib64/python3.11/site-packages/yt/geometry/geometry_handler.py", line 42, in __init__
    self._setup_data_io()
  File "/home/hvandam/pyamrex/lib64/python3.11/site-packages/yt/frontends/boxlib/data_structures.py", line 568, in _setup_data_io
    self.io = io_registry[self.dataset_type](self.dataset)
              ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
KeyError: 'boxlib_native'
(pyamrex) [hvandam@lpo-170127 test-pbar+1]$

from exaepi.

hjjvandam avatar hjjvandam commented on August 22, 2024

Hmmm, it seems like I have a mixture of yt-4.4.dev0 and yt-4.3.0 on my machine. That could cause trouble I guess. Let me create a new and clean Python environment and see how that goes.

from exaepi.

hjjvandam avatar hjjvandam commented on August 22, 2024

OK, rebuilding the environment from scratch did not fix the issue either. The one thing that does is to add

from yt.frontends.boxlib.api import (
    AMReXDataset,
    CastroDataset,
    MaestroDataset,
    NyxDataset,
    OrionDataset,
    WarpXDataset,
)

to yt/__init__.py. In ExaEpi/etc/plot.py I then just need to change line 16 to change the shape so that the size matches the size of ad["total"] and it all works. One thing I don't understand is why line 2 in plot.py does not sort the boxlib_native thing out. I.e. what is the difference between importing from yt.frontends.boxlib.data_structures and from yt.frontends.boxlib.api?

from exaepi.

hjjvandam avatar hjjvandam commented on August 22, 2024

OK, so changing line 2 in plot.py from

from yt.frontends.boxlib.data_structures import AMReXDataset

to

from yt.frontends.boxlib.api import AMReXDataset

without the changes to the yt/__init__.py also fixes the issue. Shall I generate a pull request for that change?

from exaepi.

atmyers avatar atmyers commented on August 22, 2024

Yes, could you make that change please?

Thanks!

from exaepi.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.