Bug #3510

Fix scripts show_onoff_spectrum.py

Added by Tibaldo Luigi over 3 years ago. Updated about 3 years ago.

Status:ClosedStart date:01/21/2021
Priority:NormalDue date:
Assigned To:Knödlseder Jürgen% Done:

100%

Category:-
Target version:2.0.0
Duration:

Description

The script (downloadable from http://cta.irap.omp.eu/ctools/users/tutorials/1dc/first_onoff.html) does not work after the latest changes on the SED file column names.
Perhaps transform this into example script and add unit test?


Recurrence

No recurrence.

History

#1 Updated by Knödlseder Jürgen about 3 years ago

Thanks for signalling.

A more general strategy is needed to make sure that all examples in the documentation do actually work. For the moment I do this by hand before every release, but obviously the charge for this becomes more and more important, and there is always a risk that something is missed.

I see actually two tasks here:
  1. making sure that examples given in the documentation work
  2. automatically updating examples, for example in case of an interface change

1. could be added to the unit test. It would be a script that extracts and runs examples from the Sphinx documentation.

2. could be added to the release pipeline. It would be a script that eventually modifies Sphinx documentation files.

#2 Updated by Knödlseder Jürgen about 3 years ago

  • Status changed from New to In Progress
  • Assigned To set to Knödlseder Jürgen
  • % Done changed from 0 to 10

I started working on a test script that scans an RST file and extracts the ctools or cscripts workflow and actually executed the corresponding ctool or cscript. An application to the RST file first_onoff.rst limited to the call of csobsselect works, and also correctly writes any errors in the XML report.

#3 Updated by Knödlseder Jürgen about 3 years ago

  • % Done changed from 10 to 20

I made progress with the tutorials testing script and corrected the code of the show_onoff_spectrum.py script.

#4 Updated by Knödlseder Jürgen about 3 years ago

  • % Done changed from 20 to 30

I added a target check-tutorials to the Makefile so that the tutorials check can be done using

$ make check-tutorials
The script now covers all 1DC tutorials. The environment variable CTADATA1DC defines now the location of the 1DC data that are needed for the tutorial check. If the environment variable does not exist the 1DC tutorial checks will be skipped.

Note that the 1DC tutorial check takes several hours on Mac OS. The longest part are the csphagen runs for the On/Off analysis. I added #3534 to try improving the computation speed of csphagen.

#5 Updated by Knödlseder Jürgen about 3 years ago

  • Status changed from In Progress to Pull request
  • % Done changed from 30 to 90

I added also checks for the “quickstart” and “howto” tutorials. I now merge the code in.

#6 Updated by Knödlseder Jürgen about 3 years ago

  • Status changed from Pull request to Closed
  • % Done changed from 90 to 100

Merged into devel.

Also available in: Atom PDF