Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

eventWriter raising github error #290

Open
leshanz opened this issue Feb 20, 2021 · 4 comments
Open

eventWriter raising github error #290

leshanz opened this issue Feb 20, 2021 · 4 comments

Comments

@leshanz
Copy link
Collaborator

leshanz commented Feb 20, 2021

Whenever the function eventWriter.run() is called, it raises:

fatal: not a git repository (or any of the parent directories): .git

Even for example code in /examples folder

@christophwelling
Copy link
Collaborator

Hi,
can you post the full error message please?
Which release of NuRadioReco are you using? I guess you installed it via pip?

We have a feature that when you write a nur file, the hash of your current git version is stored in the event. I would guess that is where the error happens. We changed the implementation a while ago so that it will still work if you used pip for installation (though it won't store the git versio, obviously), so I am a bit surprised by the error. Maybe just upgrading to the latest NuRadioReco release will solve the problem.

@leshanz
Copy link
Collaborator Author

leshanz commented Feb 23, 2021

Hi,

Thank you for getting back to me.

I don't think I installed it via pip, since the location of NuRadioReco is not at my site-packages folder.

The error does not stop the program, but just keeps being printed out. So the error massage looks something like:

fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git

I upgraded NuRadioReco using git pull origin master, but the problem persists. Is this the right way to do upgrading? I used eventWriter several months ago and the problem did not raise back then.

Thank you for looking into this for me.

@christophwelling
Copy link
Collaborator

That is really strange then. Can you post the full error message, especially the part where it points to the line the error occured? That would help a lot.

For upgrading best just use git pull, otherwise you will always pull in from the master, even if you are on another branch. Speaking of which, can you check that you are actually on the master branch? (git status will show that).

Do you also have NuRadioMC installed? Is it installed with git as well?

@leshanz
Copy link
Collaborator Author

leshanz commented Feb 24, 2021

The error fatal: not a git repository (or any of the parent directories): .git keeps printing out itself, but it doesn't stop the program from running, so there isn't really a Traceback error message I can copy, if that is what you were referring to. In other words, the program does its job and terminates normally, but each time eventWriter.run() gets executed, an error message gets printed out.

I do have NuRadioMC installed via git, but I have never used it before.

Thanks for the advice on upgrading. I did git pull and my git status gives:

On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean

The test code I used that produces this error is fairly simple:

import NuRadioReco.modules.io.eventWriter
eventWriter = NuRadioReco.modules.io.eventWriter.eventWriter()
eventWriter.begin("results/test.nur")

import NuRadioReco.modules.io.NuRadioRecoio as NuRadioRecoio
input = NuRadioRecoio.NuRadioRecoio(['data/station_32_run_00236.root.nur'])

from NuRadioReco.detector import detector
det = detector.Detector()

for i in input.get_events():
eventWriter.run(i)

eventWriter.end()

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants