Skip to content

Instantly share code, notes, and snippets.

import matplotlib.pyplot as plt
import hothouse
import hothouse.blaster as hb
import hothouse.scene as hs
import numpy as np
from hothouse.datasets import PLANTS
center = np.array([0.0, -100.0, 200])
forward = np.array([0.0, 1.0, 0.0])
up = np.array([0.0, 0.0, 1.0])
ahf: {}
art:
Density:
aliases: [density]
display_name: null
units: code_mass / code_length**3
Gamma:
aliases: [gamma]
display_name: null
units: ''
# https://confluence.atlassian.com/bitbucket/pullrequests-resource-423626332.html
# List of PRs:
_pr_list = "https://api.bitbucket.org/2.0/repositories/%(owner)s/%(repo_slug)s/pullrequests?state=OPEN,MERGED,DECLINED"
# Comments on a PR:
_pr_comments = "https://api.bitbucket.org/2.0/repositories/%(owner)s/%(repo_slug)s/pullrequests/%(pull_request_id)s/comments"
# Specific comment:
# https://api.bitbucket.org/2.0/repositories/{owner}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}
import glob
import pandas as pd
yteps = {}
for fn in sorted(glob.glob("YTEPs/*.rst")):
with open(fn, "r") as f:
ytep_id = fn.rsplit("-", 1)[-1][:-4]
yteps[ytep_id] = {}
lines = f.readlines()
import pprint, h5py, glob, time
ptypes = ["PartType0", "PartType1", "PartType4"]
counts = {}
fields = {}
fns = glob.glob("snapshot_033/snap_033.*.hdf5")
fns.sort()
github.com/AlDanial/cloc v 1.74 T=6.43 s (109.0 files/s, 30730.0 lines/s)
-----------------------------------------------------------------------------------------------------------------------------------
File blank comment code
-----------------------------------------------------------------------------------------------------------------------------------
yt/visualization/_colormap_data.py 106 54 8268
yt/frontends/stream/sample_data/hexahedral_mesh.py 3 2 6195
yt/frontends/stream/sample_data/tetrahedral_mesh.py 3 2 3280
yt/geometry/selection_routines.pyx 253 169 2041
yt/visualization/plot_mod
@matthewturk
matthewturk / diff.patch
Created May 17, 2019 15:27
chunk indices
diff --git a/yt/data_objects/particle_store.py b/yt/data_objects/particle_store.py
index 7ac3e72ee..1249c0b7c 100644
--- a/yt/data_objects/particle_store.py
+++ b/yt/data_objects/particle_store.py
@@ -61,7 +61,8 @@ class ParticleFile(metaclass = abc.ABCMeta):
end = np.clip(start + self.chunk_size, 0, npart)
cinds[ptype] = np.array([(si, ei) for si, ei in zip(start, end)])
self._chunk_indices = cinds
- self._num_chunks = max(len(_) for _ in cinds.values())
+ # We have chunks for each
We can't make this file beautiful and searchable because it's too large.
X,Y,OBJECTID,Sign_Type,Size_,Supplement,Sign_Post,Year_Insta,Category,Notes,MUTCD,Ownership,FACILITYID,Schools,Location_Adjusted,Replacement_Zone,Sign_Text,Set_ID,FieldVerifiedDate
-88.239282647365044,40.14924512182376,1,Streetname - Mast Arm,"16"" X 42""", ,Traffic Signal Mast Arm, ,Streetname, ,D3-1,Champaign,1,,Aerial Photography Adjusted,L,Mercury Dr,1,
-88.239280053674577,40.149446757522412,2,Streetname - Mast Arm,"16"" X 42""", ,Traffic Signal Mast Arm, ,Streetname, ,D3-1,Champaign,2,,Aerial Photography Adjusted,L,N Market St,2,
-88.292373132919053,40.09312303461725,3,No Outlet,"30"" X 30""", ,Punched Telespar,2010,Warning, ,W14-2,Champaign,3,,Aerial Photography Adjusted,E,,3,
-88.295052408353669,40.095087991656165,4,No Outlet,"30"" X 30""", ,Punched Telespar,2010,Warning, ,W14-2,Champaign,4,,Aerial Photography Adjusted,E,,4,
-88.284991974020514,40.097600580598019,5,No Outlet,"30"" X 30""", ,Punched Telespar,2010,Warning, ,W14-2,Champaign,5,,Aerial Photography Adjusted,E,,5,
-88.279960058947736,40.09435
import yaml
import yt
from yt.frontends.api import _frontends
field_infos = {}
for fn in _frontends:
f = getattr(yt.frontends, fn)
field_infos[fn] = [getattr(f, _) for _ in dir(f) if "Field" in _]
# =================================================================================================================
# NOTE:
# 1. Comment symbol: #
# 2. [*]: defaults
# 3. Parameters set to "auto" (usually by setting to a negative value) do not have deterministic default values
# and will be set according to the adopted compilation options and/or other runtime parameters
# 4. To add new parameters, please edit "Init/Init_Load_Parameter.cpp"
# 5. All dimensional variables should be set consistently with the code units (set by UNIT_L/M/T/V/D)