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

Failing integration test on simulate_light_emission #1124

Closed
GernotMaier opened this issue Sep 2, 2024 · 4 comments
Closed

Failing integration test on simulate_light_emission #1124

GernotMaier opened this issue Sep 2, 2024 · 4 comments
Assignees

Comments

@GernotMaier
Copy link
Contributor

I am trying to figure out why this fails in the branch remove-prodN-and-metadata , but I can't see that is going wrong:

pytest --model_version="6.0.0" --no-cov -n auto tests/integration_tests/test_applications_from_config.py::test_applications_from_config[simtools-simulate-light-emission_run-layout]

gives me


Starting run 1
INFO::utils(l161)::_init_num_threads::NumExpr defaulting to 10 threads.
INFO::eventsource(l163)::__init__::INPUT PATH = /tmp/pytest-of-root/pytest-7/popen-gw0/test-data0/simtools-simulate-light-emission-run-layout/simtools-tests/xyzls_layout.simtel.gz
INFO::eventsource(l166)::__init__::Max events being read = 1
INFO::provenance(l86)::_get_current_or_start_activity::No activity has been explicitly started, starting new default activity. Consider calling Provenance().start_activity(<name>) explicitly.
INFO::base(l61)::__init__::Opening new file /tmp/pytest-of-root/pytest-7/popen-gw0/test-data0/simtools-simulate-light-emission-run-layout/simtools-tests/xyzls_layout.simtel.gz
INFO::base(l71)::__init__::Found gzipped file
INFO::base(l74)::__init__::Trying to read using zcat
INFO::base(l84)::__init__::Using zcat
WARNING::simulate_light_emission(l450)::main::telescope not triggered at distance of 776.5919942930135 m
Traceback (most recent call last):
  File "/workdir/env/bin/simtools-simulate-light-emission", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/workdir/external/simtools/simtools/applications/simulate_light_emission.py", line 452, in main
    [fig],
     ^^^
UnboundLocalError: cannot access local variable 'fig' where it is not associated with a value
-------------------------------------------------------------------------- Captured log call ---------------------------------------------------------------------------
INFO     root:test_applications_from_config.py:350 Temporary output path: /tmp/pytest-of-root/pytest-7/popen-gw0/test-data0/simtools-simulate-light-emission-run-layout
INFO     root:test_applications_from_config.py:351 Test configuration from config file: {'APPLICATION': 'simtools-simulate-light-emission', 'TEST_NAME': 'run-layout', 'MODEL_VERSION_USE_CURRENT': True, 'CONFIGURATION': {'SITE': 'North', 'TELESCOPE': 'MSTN-04', 'ILLUMINATOR': 'ILLN-01', 'LIGHT_SOURCE_SETUP': 'layout', 'MODEL_VERSION': '6.0.0', 'LIGHT_SOURCE_TYPE': 'led', 'OUTPUT_PATH': 'simtools-tests', 'TELESCOPE_FILE': 'tests/resources/telescope_positions-North-ground.ecsv'}}
INFO     root:test_applications_from_config.py:352 Model version: 6.0.0
@GernotMaier
Copy link
Contributor Author

I have solved this by moving the save_fig statement into the try..except statement.

But: an expert (@tobiaskleiner) might want to look why the telescope did not trigger. I guess we want a triggered telescope?

@tobiaskleiner
Copy link
Collaborator

Yes, this is not expected. We should always trigger the telescope and being able to produce the figure. Looking into this.

@GernotMaier
Copy link
Contributor Author

@tobiaskleiner - this issue has been addressed with pull request #1128 ? If yes, could you please close it?

@tobiaskleiner
Copy link
Collaborator

Closing as this was fixed in #1128.

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

2 participants