Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import xarray as xr | |
| import yt | |
| import os | |
| import numpy as np | |
| import cartopy.feature as cfeature | |
| import cartopy.crs as ccrs | |
| ddir = os.path.join(yt.config.ytcfg.get('yt','test_data_dir'), 'sample_nc') | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # running mypy on this file fails: | |
| # error: Only concrete class can be given where "Type[Student]" is expected | |
| import abc | |
| import functools | |
| # https://docs.python.org/3/library/functools.html#functools.total_ordering | |
| @functools.total_ordering | |
| class Student(abc.ABC): | |
| def __init__(self, firstname: str, lastname: str): | |
| self.firstname = firstname |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import yt | |
| from yt_idv import render_context | |
| from yt_idv.scene_data.block_collection import BlockCollection | |
| from yt_idv.scene_components.blocks import BlockRendering | |
| ds = yt.load('m1.0_p16_b2.0_300k_plt50/multitidal_hdf5_plt_cnt_0200') | |
| ad = ds.all_data() | |
| rc = render_context(height=800, width=800, gui=True) | |
| sg = rc.add_scene(ds, None) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # based on callbacks from https://yt-project.org/doc/visualizing/callbacks.html#overplot-halo-annotations | |
| import yt | |
| # annotation markers and text | |
| ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030") | |
| s = yt.SlicePlot(ds, "x", ("gas", "density")) | |
| s.set_axes_unit("kpc") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import unyt | |
| import xmltodict | |
| import sys | |
| import os | |
| class VTKUnitChecker(object): | |
| """a recursive unit checker for xml vtu/pvtu files from ASPECT | |
| This module recursively searches the elements of an xml vtk files, looking for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # initialization file (not found) |
NewerOlder