Giter VIP home page Giter VIP logo

uproot.jl's Introduction

UpROOT.jl

Documentation for stable version Documentation for development version License Build Status Codecov

UpROOT.jl makes it possible to read and write CERN ROOT files without requiring a ROOT installation. It is a wrapper around the Python package uproot, which provides a pure-Python implementation of ROOT I/O. There also exists a pure-Julia ROOT file reading library UnROOT.jl that is built for speed and memory efficiency.

See the documentation for details:

Documentation

uproot.jl's People

Contributors

alusiani avatar gipert avatar juliatagbot avatar moelf avatar oschulz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

uproot.jl's Issues

Tree Conversion Error

Hey, I tried to open a TTree with uproot.jl and got the following error
Error showing value of type TTree:
ERROR: KeyError: key "name" not found
Stacktrace:
[1] getproperty(::PyObject, ::String) at .../packages/PyCall/ttONZ/src/PyCall.jl:308
[2] getproperty(::PyObject, ::Symbol) at .../packages/PyCall/ttONZ/src/PyCall.jl:313
[3] awkwardobjectarray2jl(::PyObject) at .../packages/UpROOT/nF6Gy/src/pyjlconv.jl:25

It seems that the PyCall Code has changed.

UpROOT crashes Atom

When julia is killed while the TTree reading is being processed Atom crashes.

image

Julia 1.3.0
Windows 10

Can someone reproduce?

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

[compat] Tables = "0.2" does not seem to accept 1.0.0

(v1.3) pkg> develop --local UpROOT
  Updating registry at `C:\Users\mikha\.julia\registries\General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
  Updating git-repo `https://github.com/JuliaHEP/UpROOT.jl.git`
 Resolving package versions...
ERROR: Unsatisfiable requirements detected for package Tables [bd369af6]:
 Tables [bd369af6] log:
 ├─possible versions are: [0.1.0-0.1.15, 0.1.17-0.1.19, 0.2.0-0.2.11, 1.0.0-1.0.2] or uninstalled
 ├─restricted to versions 0.2 by UpROOT [69ce31c6], leaving only versions 0.2.0-0.2.11
 │ └─UpROOT [69ce31c6] log:
 │   ├─possible versions are: 0.2.1 or uninstalled
 │   └─UpROOT [69ce31c6] is fixed to version 0.2.1
 └─restricted by compatibility requirements with CSV [336ed68f] to versions: 1.0.0-1.0.2 — no versions left
   └─CSV [336ed68f] log:
     ├─possible versions are: [0.3.0-0.3.1, 0.4.0-0.4.3, 0.5.0-0.5.24] or uninstalled
     └─restricted to versions 0.5.24 by an explicit requirement, leaving only versions 0.5.24

Recognition of TTree breaks when matrices are in branches

My ROOT tree contains covariance matrices,
the tree[1] breaks when Table is created

https://github.com/JuliaHEP/UpROOT.jl/blob/master/src/ttree.jl#L40

It happens because _ndims(nt) of TypedTables.jl is confused.

_ndims(::Type{<:Tuple{Vararg{AbstractArray{<:Any, n}}}}) where {n} = n

It wants that all object in the tuple are n-dims. arryas.

For some reason for matrices in branches pyobj(tree).arrays returns not an array of matrices, but 3d matrices.

https://github.com/JuliaHEP/UpROOT.jl/blob/master/src/ttree.jl#L39

Histogram edges retrieval bug

I cannot read histograms from this ROOT file. I think it's a floating point arithmetic issue.

julia> using UpROOT
julia> UpROOT.TFile("histos.root")["h_comp_roi"]
ERROR: Histogram edge vectors must be 1 longer than corresponding weight dimensions
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] Histogram
   @ ~/.julia/packages/StatsBase/DU1bT/src/hist.jl:193 [inlined]
 [3] Histogram (repeats 2 times)
   @ ~/.julia/packages/StatsBase/DU1bT/src/hist.jl:199 [inlined]
 [4] roothist2jl(x::PyCall.PyObject)
   @ UpROOT ~/.julia/packages/UpROOT/YRyC3/src/pyjlconv.jl:58
 [5] py2jl(x::PyCall.PyObject)
   @ UpROOT ~/.julia/packages/UpROOT/YRyC3/src/pyjlconv.jl:78
 [6] getindex(tdir::TDirectory, objname::String)
   @ UpROOT ~/.julia/packages/UpROOT/YRyC3/src/tdirectory.jl:33
 [7] top-level scope
   @ REPL[8]:1

The right edges in the original histograms are 0:0.2:100, but the reconstructed range is 0.0:0.20000000000000004:99.80000000000003, which explains the error.

If I remove this if ... else here:

https://github.com/JuliaHEP/UpROOT.jl/blob/master/src/pyjlconv.jl#L45-L47

and just return edge, everything works as expected. Why trying to convert the histogram edges to a range object? Is there a performance gain?

free() invalid pointer when using UpROOT PythonPlot

The following minimum example code

using PythonPlot
using UpROOT

fails with:

free(): invalid pointer
signal (6): Aborted

Julia 1.7.3
UpROOT v0.3.3
PythonPlot v1.0.0

I guess it should be related to both packages calling Python.

Can plotting recipies for TH1D, TGraph, TGraphError be a part of the package?

Here is how I plot TGraphError extracted from TFile,

f = TFile("test.root")
c = f["myTGE"]  # typo of object PyObject <b'TGraphErrors' b'myTGE' 0x00003a8740f0>
plot(
    vcat(c.xvalues...),
    vcat(c.yvalues...),
    xerr = vcat(c.xerrors...), yerr = vcat(c.yerrors...),
    lab="",
    xlab = latexstring(replace(c.xlabel,"text" => "mathrm")),
    ylab = latexstring(replace(c.ylabel,"text" => "mathrm")),
    title = c.title
)

I think it would make a lot of sense to write a few recipes. I am just not sure how to check subtypes of these PyObject without writing the parser

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.