Last Update: May 13, 2019
Offline Version
Execute the commands chunk by chunk because I haven't tested this as a whole
# setup environment
cd /cvmfs/cms.cern.ch/slc7_amd64_gcc630/cms/cmssw/CMSSW_10_2_0_pre6/ ; cmsenv ; cd -
# make containment folder somewhere and get vi
mkdir vim8
cd vim8
git clone https://github.com/vim/vim
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 time | |
import numpy as np | |
import pandas as pd | |
import uproot | |
from yahist import Hist1D, Hist2D | |
from pandas.core.base import PandasObject | |
from cachetools import cached, LRUCache | |
from cachetools.keys import hashkey | |
def myhasher(*args, **kwargs): |
This file contains 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
# Electromagnetic simulation at varying timescales - simulation code to make this animation: | |
# https://twitter.com/bencbartlett/status/1369396941730312193 | |
# | |
# Animation idea was inspired by u/cenit997's (Twitter: @__cenit) Reddit post: | |
# https://www.reddit.com/r/Python/comments/hxmhai/a_simulation_of_how_an_incoherent_light_source/ | |
#--- | |
using LinearAlgebra, Base.Threads, BenchmarkTools, LoopVectorization, CSV, DataFrames, Printf, Plots |
The Jax developers optimized a differential equation benchmark in this issue which used DiffEqFlux.jl as a performance baseline. The Julia code from there was updated to include some standard performance tricks and is the benchmark code here. Thus both codes have been optimized by the library developers.
Since writing out ROOT files is currently not possible with UnROOT
, one can write out Arrow files
directly from an UnROOT.LazyTree
object which can be read back in julia.
With some consideration of the chunking, this won't use much memory.
using UnROOT
using Arrow
using Tables
treename = "Events"
filename = "18BCCE71-15B8-194B-8738-EC993C8DD3BD.root"
This file contains 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
# Add this file to ~/.julia/config/ (mkdir config if necessary) | |
try | |
using Revise | |
catch e | |
@warn "Error initializing Revise: trying install" exception=(e, catch_backtrace()) | |
using Pkg | |
Pkg.add("Revise") | |
end |
This file contains 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
@recipe(Barplot3D) do scene | |
Attributes( | |
color = theme(scene, :markercolor), | |
colormap = theme(scene, :colormap), | |
) | |
end | |
Makie.conversion_trait(::Type{<:Barplot3D}) = Makie.DiscreteSurface() | |
function Makie.plot!(p::Barplot3D) |
This file contains 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
#Helpers: | |
"Given some IR generates a MethodInstance suitable for passing to infer_ir!, if you don't already have one with the right argument types" | |
function get_toplevel_mi_from_ir(ir, _module::Module) | |
mi = ccall(:jl_new_method_instance_uninit, Ref{Core.MethodInstance}, ()); | |
mi.specTypes = Tuple{ir.argtypes...} | |
mi.def = _module | |
return mi | |
end | |
"run type inference and constant propagation on the ir" |
OlderNewer