Feature #2190

Add GammaLib code generator

Added by Knödlseder Jürgen over 6 years ago. Updated about 6 years ago.

Status:In ProgressStart date:09/02/2017
Priority:NormalDue date:
Assigned To:Knödlseder Jürgen% Done:

50%

Category:-
Target version:-
Duration:

Description

A code generation script should be added to automatically generate new classes, and in particular new instrument modules.


Recurrence

No recurrence.

History

#1 Updated by Knödlseder Jürgen over 6 years ago

  • % Done changed from 0 to 50

I made good progress with the code generator, and now a first script is available. It’s called codegen.py and it’s in dev. The script is able to create a new instrument module (or to append missing classes to an existing instrument module), including the creation of unit tests. Here is how it works:

$ make clean
$ dev/codegen.py

GammaLib code generator
=======================

[1] Add instrument module
[2] Add spectral model
[3] Add spatial model
[4] Add temporal model
[4] Add generic class
[q] Quit
Enter your choice: 1

Add instrument module
---------------------
Please enter a 3 digit-name for the module: dmp
Please enter the instrument name (e.g. "Fermi/LAT"): DAMPE
Please enter your name (e.g. "Joe Public"): Joe Public's friend
All right. Have now:
Module name .....: "dmp" 
Instrument name .: "DAMPE" 
Your name .......: "Joe Public's friend" 
Is this correct? (y/n): y
All right. You want a new "dmp" instrument module.
Do you want event list support? (y/n): y
Do you want binned event data support? (y/n): y

[1] Add instrument module
[2] Add spectral model
[3] Add spatial model
[4] Add temporal model
[4] Add generic class
[q] Quit
Enter your choice: q
$ autoconf
$ automake
$ ./configure
$ make
$ make check
and you have a brand new DAMPE instrument interface compiled and tested. Following that you can start implementing.

#2 Updated by Knödlseder Jürgen over 6 years ago

The current version of the code generator is already merged into devel.

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

  • Status changed from New to In Progress

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

  • Target version deleted (1.5.0)

Also available in: Atom PDF