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

YAML format #46

Open
ahmed-f-alrefaie opened this issue Feb 3, 2025 · 0 comments
Open

YAML format #46

ahmed-f-alrefaie opened this issue Feb 3, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@ahmed-f-alrefaie
Copy link
Contributor

ahmed-f-alrefaie commented Feb 3, 2025

Given the complexity of new models, I think moving to the YAML format will probably be worth doing as it provides far greater flexibility than configobj (Which is becoming very deprecated).

For example loading in 3D data, nesting models or replicating contributions or having generic dataloaders. It will also get rid of the need to build proxies (looking at @QuentChangeat here).
For example we can couple the temperature, planet and star to a fictional multimodel model that simulates a bunch of models simultaneously while giving them different chemistries:

globals:
   xsec_path: $TAUREX_XSEC_PATH
   cia_path: $TAUREX_CIA_PATH

shared:
   sample_temperature:
      type: temperature:array_temp
      temperature_array: [300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500]
      temperature_unit: K

   sample_planet:
      type: planet:planet
      planet_radius: 1.0
      planet_mass: 1.0
      planet_sma: 1.0

   sample_star:
      type: star:blackbody
      temperature: 5778
      radius: 1.0
      distance: 10.0

    


main_model:
    type: model:multimodel
    model_list:
      -  type: model:eclipse
         temperature: sample_temperature
         atm_min_pressure: 10
         atm_max_pressure: 100
         chemistry: 
               type: chemistry:free
               fill_species: ['H2','He']
               fill_ratio: 0.78
               gases:
               - type: gas:constant
                  molecule_name: H2O
                  mix_ratio: 1e-3
               - type: gas:constant
                  molecule_name: CO2
                  mix_ratio: 1e-4
               - type: gas:constant
                  molecule_name: CH4
                  mix_ratio: 1e-5
         planet: sample_planet
         star: sample_star
         contributions:
            - type: contribution:absorption
            - type: contribution:cia
              cia_pairs: ['H2-H2','H2-He']
      -  type: model:transit
         temperature: sample_temperature
         atm_min_pressure: 10
         atm_max_pressure: 100
         chemistry: 
               type: chemistry:free
               fill_species: ['H2','He']
               fill_ratio: 0.78
               gases:
               - type: gas:constant
                  molecule_name: CO2
                  mix_ratio: 1e-3
               - type: gas:constant
                  molecule_name: NH3
                  mix_ratio: 1e-4
         planet: sample_planet
         star: sample_star
         contributions:
            - type: contribution:absorption
            - type: contribution:cia
              cia_pairs: ['H2-H2','H2-He']
            - type: contribution:rayleigh
            - type: contribution:clouds

In addition we can easily support environment variables so files can be shared between users.

Additionally since the YAML format converts to a dictionary it is easily integrated into the taurex factory system and we can still maintain compatibility with the old par format as well.

@ahmed-f-alrefaie ahmed-f-alrefaie added the enhancement New feature or request label Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant