Skip to content
Snippets Groups Projects
Commit aaaf823c authored by Nikolai.Hartmann's avatar Nikolai.Hartmann
Browse files

don't dump DataFrame in ClassificationProjectDataFrame initialisation

parent 38978a49
No related branches found
No related tags found
No related merge requests found
...@@ -1508,6 +1508,22 @@ class ClassificationProjectDataFrame(ClassificationProject): ...@@ -1508,6 +1508,22 @@ class ClassificationProjectDataFrame(ClassificationProject):
A little hack to initialize a ClassificationProject from a pandas DataFrame instead of ROOT TTrees A little hack to initialize a ClassificationProject from a pandas DataFrame instead of ROOT TTrees
""" """
def __init__(self, name, *args, **kwargs):
if len(args) < 1 and len(kwargs) < 1:
# if no further arguments given, interpret as directory name
self._init_from_dir(name)
else:
# otherwise initialise new project
self._init_from_args(name, *args, **kwargs)
with open(os.path.join(self.project_dir, "options.pickle"), "wb") as of:
# don't put the dataframe into options.pickle!
if len(args) > 1:
args = args[1:]
else:
args = []
pickle.dump(dict(args=args, kwargs=kwargs), of)
def _init_from_args(self, def _init_from_args(self,
name, name,
df, df,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment