Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opengate_tests error "The data are not correct" #245

Closed
franky180 opened this issue Oct 4, 2023 · 8 comments
Closed

Opengate_tests error "The data are not correct" #245

franky180 opened this issue Oct 4, 2023 · 8 comments

Comments

@franky180
Copy link

Trying to install opengate on a plain Ubuntu 22.04.3 LTS system I encountered the following error:

(opengate_env) user@ssmptest:~$ opengate_tests
Geant4 data folder does not exist.
I will create it for you here: /home/user/opengate_env/lib/python3.10/site-packages/opengate_core/geant4_data
... and download the G4 data.
This will take a moment.

Downloading 1/12 https://cern.ch/geant4-data/datasets/G4NDL.4.7.tar.gz
100% [....................................................................] 1114928821 / 1114928821Extracting the data archive (tar) ...
done

... (2/12 to 11/12 were downloaded successfully too)...

Downloading 12/12 https://cern.ch/geant4-data/datasets/G4ENSDFSTATE.2.3.tar.gz
100% [............................................................................] 290745 / 290745Extracting the data archive (tar) ...
done

Done
No Opengate test data available in: /home/user/opengate_env/lib/python3.10/site-packages/opengate_core/../opengate/tests/data
I download it for you.

Done
Look for tests in: /home/user/opengate_env/lib/python3.10/site-packages/opengate/tests/../tests/src
The data are not correct in: /home/user/opengate_env/lib/python3.10/site-packages/opengate/tests/../tests/src/../data
Activate LFS and download them with:
git submodule update --init --recursive

I already tried to update the git submodule as suggested by the error message. This leads to the following error message:
fatal: not a git repository (or any of the parent directories): .git
The files in /tests/src/ and in /tests/data/ were successfully downloaded.

Is there anything I can do to fix this issue?

@tbaudier
Copy link
Contributor

tbaudier commented Oct 4, 2023

How do you install opengate? With: pip install --pre opengate ?

Because this version contains that error. Try to download the latest wheels here (at the bottom, click on dist) :
https://github.com/OpenGATE/opengate/actions/runs/6399870943

The problem will be solved with the next release

@jizhang02
Copy link

How do you install opengate? With: pip install --pre opengate ?

Because this version contains that error. Try to download the latest wheels here (at the bottom, click on dist) : https://github.com/OpenGATE/opengate/actions/runs/6399870943

The problem will be solved with the next release

hi, where should I put the 'dist'?
thanks

@tbaudier
Copy link
Contributor

tbaudier commented Oct 5, 2023

You can unzip the archive. Then go to the dist folder and do:
pip install opengate_core<>.whl
pip install opengate-0.7.3-py3-none-any.whl

Replace the <> by the version of python and os you need

@jizhang02
Copy link

The testing does not work for me. It almost drive me crazy.
It's good that you can share your well-installed and tested docker or virtual machine file.
But there is another solution for this problem:
#79 (comment)

@dsarrut
Copy link
Contributor

dsarrut commented Oct 5, 2023

oh nice ! We will investigate, but we cannot really reproduce this bug, so it is difficult from our side.

For this error:

I already tried to update the git submodule as suggested by the error message. This leads to the following error message: fatal: not a git repository (or any of the parent directories): .git The files in /tests/src/ and in /tests/data/ were successfully downloaded.

I think you were not in the correct folder ("not a git repository"), if you try this while being in the opengate folder, it should not lead to this error.

@tbaudier
Copy link
Contributor

tbaudier commented Oct 5, 2023

Great, BTW it should be easy with the next release

@tbaudier tbaudier closed this as completed Oct 5, 2023
@franky180
Copy link
Author

franky180 commented Oct 6, 2023

Try to download the latest wheels here (at the bottom, click on dist) : https://github.com/OpenGATE/opengate/actions/runs/6399870943

Thank you so much for your quick response. I just followed your advice and installed the verison you suggested (opengate-10.0b3-py3-none-any.whl and opengate_core-10.0b3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl for my Python 3.10.12).

I just ran into another error that I cannot make sense of which seems to be occuring in the digitizers.py file. Any ideas how to fix that?

(opengate_env) user@ssmptest:~/opengate_env/lib/python3.10/site-packages/opengate$ opengate_tests
Importing opengate ...
No correct Opengate test data version in: /home/user/opengate_env/lib/python3.10/site-packages/opengate_core/../opengate/tests/data
I update it for you.

Done
Traceback (most recent call last):
  File "/home/user/opengate_env/bin/opengate_tests", line 10, in <module>
    from opengate.exception import fatal, colored, color_ok, color_error
  File "/home/user/opengate_env/lib/python3.10/site-packages/opengate/__init__.py", line 7, in <module>
    from opengate.managers import Simulation
  File "/home/user/opengate_env/lib/python3.10/site-packages/opengate/managers.py", line 9, in <module>
    from .element import new_element
  File "/home/user/opengate_env/lib/python3.10/site-packages/opengate/element.py", line 4, in <module>
    from .actors.actorbuilders import actor_builders, actor_type_names
  File "/home/user/opengate_env/lib/python3.10/site-packages/opengate/actors/__init__.py", line 1, in <module>
    from . import digitizers, doseactors, miscactors, filters
  File "/home/user/opengate_env/lib/python3.10/site-packages/opengate/actors/digitizers.py", line 421, in <module>
    class DigitizerEfficiencyActor(g4.GateDigitizerEfficiencyActor, ActorBase):
AttributeError: module 'opengate_core' has no attribute 'GateDigitizerEfficiencyActor'. Did you mean: 'GateDigitizerBlurringActor'?

Edit: I installed CL#1316 and I don't see this error anymore.

@HyperionCore
Copy link

HyperionCore commented Oct 10, 2023

the problem is caused by hash verification error:

  1. in your env, for example for mine is "/home/mi/miniconda3/envs/vgate/bin/"

  2. open the opengate_tests by text editor

  3. looking for this place, just comment it:

//////////////////
# if (
# not readable_hash
# # == "91c3bbac271f75ac6cbeb413d892933f4b3369fa5a747a55004e113b31d1c84c"
# == "969384aa7bbc9b6125136e0edf7835e149d25b920e1885e12e58b846c28a101f"
# ):
# print(
# colored.stylize(
# "The data are not correct in: " + os.path.join(mypath, "..", "data"),
# color_error,
# )
# )
# print("Activate LFS and download them with:")
# print("git submodule update --init --recursive")
# return False
//////////////////

all done, you can run tests now.

but there is another problem, all tests running seems correctly, but why the result is failed ??

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

No branches or pull requests

5 participants