nu-radio / NuRadioReco

reconstruction framework for radio detectors of high-energy neutrinos
GNU General Public License v3.0
5 stars 3 forks source link

eventWriter raising github error #290

Open leshanz opened 3 years ago

leshanz commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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()