Skip to content

Commit

Permalink
babyyoda.yoda requires yoda import
Browse files Browse the repository at this point in the history
  • Loading branch information
APN-Pucky committed Oct 15, 2024
1 parent e662bde commit ca7945d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/babyyoda/yoda/histo1d.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import yoda
from packaging import version

import babyyoda
Expand All @@ -9,7 +10,6 @@ def __init__(self, *args, **kwargs):
"""
target is either a yoda or grogu HISTO1D_V2
"""
import yoda

target = args[0] if len(args) == 1 else yoda.Histo1D(*args, **kwargs)
# unwrap target
Expand Down
2 changes: 1 addition & 1 deletion src/babyyoda/yoda/histo2d.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import yoda
from packaging import version

import babyyoda
Expand All @@ -9,7 +10,6 @@ def __init__(self, *args, **kwargs):
"""
target is either a yoda or grogu HISTO2D_V2
"""
import yoda

target = args[0] if len(args) == 1 else yoda.Histo2D(*args, **kwargs)

Expand Down
3 changes: 2 additions & 1 deletion src/babyyoda/yoda/read.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import yoda as yd

from babyyoda.yoda.histo1d import Histo1D
from babyyoda.yoda.histo2d import Histo2D

Expand All @@ -6,7 +8,6 @@ def read(file_path: str):
"""
Wrap yoda histograms in the by HISTO1D_V2 class
"""
import yoda as yd

ret = {}
for k, v in yd.read(file_path).items():
Expand Down
4 changes: 2 additions & 2 deletions src/babyyoda/yoda/write.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import warnings

import yoda as yd

def write(anyhistograms, file_path: str, *args, gz=False, **kwargs):
import yoda as yd

def write(anyhistograms, file_path: str, *args, gz=False, **kwargs):
if gz and not file_path.endswith((".gz", ".gzip")):
warnings.warn(
"gz is True but file_path does not end with .gz or .gzip", stacklevel=2
Expand Down

0 comments on commit ca7945d

Please sign in to comment.