API Reference Manual
This is the main API for getting instrument descriptions from the instrument database
- class instrumentdatabaseapi.instrumentdatabaseapi.Repository(url='https://github.com/PaNOSC-ViNYL/instrument_database.git', local_repo='/dev/shm/instrumentDBAPI/')[source]
Bases:
object- Class Repository
The API to interact with the instrument database is offered by the Repository class
Initiate the repository from an URL or local repo
- Parameters
- init(url='https://github.com/PaNOSC-ViNYL/instrument_database.git', local_repo='/tmp/instrumentDBAPI/', branch='shervin')[source]
Initiate the repository from an URL or local repo
- ls_instruments(institute)[source]
Print the names of the available instruments
- Parameters
institute (
str) – name of the institute as returned byls_institutes()- Return type
- ls_versions(institute, instrument)[source]
Print all implemented versions for the given instrument
- Parameters
institute (
str) – name of the institute as returned byls_institutes()instrument (
str) – name of the instrument as returned byls_instruments()
- Version formats:
HEAD is the most recent up-to-date version of the instrument and it is still currently in use
YYYY/MM/DD last day of validity of the instrument description. After that date, the instrument have been either modified (so more recent version should be available) or it not in service anymore
- Return type
- ls_simulation_programs(institute, instrument, version)[source]
Print the list of simulation programs for which an instrument is implemented
- Return type
- ls_flavours(institute, instrument, version, simulation_program)[source]
A given instrument might be technically implemented in different ways. Flavours are strings meant to distinguish these different implementations. By default an empty string should be used for an instrument.
- Return type
- validation_dir(institute, instrument, version='HEAD', simulation_program='', flavour='')[source]
Return the path where the test simulation results are stored. The simulation results are performed to validate the instrument.
- Parameters
- Return type
- load(institute, instrument, version='HEAD', simulation_program='', flavour='', dep=True)[source]
Load an intrument from the repository
- Parameters
simulation_program (
str) – name of the simulation programinstitute (
str) – name of the instituteinstrument (
str) – name of the instrumentversion (
str) – version nameflavour (
str) – optional string that might identify two alternative implementations of the same instrument with the same versiondep (
bool) – download python dependencies in requirements.txt for the instrument if dep == True
- Return type
<module ‘libpyvinyl.Instrument’ from ‘/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/libpyvinyl/Instrument.py’>
- Returns
the instrument object
- Raise
NotImplementedError if the instrument module does not provide a def_instrument method