hitranonline / hapi2

HITRAN Application Programming Interface on Steroids
GNU General Public License v3.0
19 stars 5 forks source link

How can I update a linelist #6

Open BenediktBurger opened 1 year ago

BenediktBurger commented 1 year ago

I downloaded transitions for one isotopologue with the name "h2o" (btw, it is good to explain the parameters in the docstring, I did not know, what the parameter "llist" did).

How can I replace the previous line list with a new one, which contains, for example, more isotopologues or another wavenumber range? I deleted the files "h2o.data" and "h2o.header", but fetch_transitions still raises "linelist h2o already exists".

RomanKochanov commented 1 year ago

Hi Benedikt,

Currently the linelists are immutable. This is a temporary measure to ensure the data provenance chains are always correct. Now there two options: either use different name, or delete the old linelist from the database, for instance, using the SQLAlchemy API:

session.delete(linelist)

Best wishes, Roman

BenediktBurger commented 1 year ago

Thanks for the explanation.

bujiren commented 1 year ago

Hello, I would like to ask how this problem is solved, where is the code session.delete(linelist) added

bujiren commented 1 year ago

I deleted the files "h2o.data" and "h2o.header", but fetch_transitions still raises "linelist h2o already exists".After I delete the local file automatically generated in the running, it can run correctly.