Repository: radis/radis (language: python)

Issue:
Update documentation of radis.json
### 🎯 Todo
<!--- A clear and concise description of what you want to happen. -->

Following #167  RADIS switched the configuration file format from ~/.radis to radis.json   
Documentation should be updated accordingly. 




Discussion / hints:
@anandxkumar do I assign you ?
Yes @erwanp, I would like to work on it. As I worked on #167, I'm familiar with the files that have been changed. It will be a good experience with the documentation stuff :)  
Nice if you can also add the possibility to keep comments in the json file, as discussed in https://github.com/radis/radis/pull/212#issuecomment-813579751

I just found out I needed it (commenting one database line for a test !) .
Yes, @erwanp, I would work on both!

Fix patch:
diff --git a/README.rst b/README.rst
index a250359cf..07f1154e9 100644
--- a/README.rst
+++ b/README.rst
@@ -63,7 +63,7 @@ Advanced use
 The Quick Start examples automatically downloads the line databases from `HITRAN-2016 <https://radis.readthedocs.io/en/latest/references/references.html#hitran-2016>`__, which is valid for temperatures below 700 K.
 For *high temperature* cases, you may need to use other line databases such as
 `HITEMP-2010 <https://radis.readthedocs.io/en/latest/references/references.html#hitemp-2010>`__ (typically T < 2000 K) or `CDSD-4000 <https://radis.readthedocs.io/en/latest/references/references.html#cdsd-4000>`__ (T < 5000 K). HITEMP can also be downloaded
-automatically, or can be downloaded manually and described in a ``~/.radis``
+automatically, or can be downloaded manually and described in a ``~/radis.json``
 `Configuration file <https://radis.readthedocs.io/en/latest/lbl/lbl.html#label-lbl-config-file>`__.
 
 More complex `examples <https://radis.readthedocs.io/en/latest/examples.html#label-examples>`__ will require to use the `SpectrumFactory <https://radis.readthedocs.io/en/latest/source/radis.lbl.factory.html#radis.lbl.factory.SpectrumFactory>`__
diff --git a/docs/index.rst b/docs/index.rst
index e90cea1c9..7f59f3c27 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -126,7 +126,7 @@ More examples
 
 The Quick Start examples above automatically downloaded the line databases from [HITRAN-2016]_, which is valid for temperatures below 700 K.
 For *high temperature* cases, you may need to use :ref:`other line databases <label_line_databases>` such as
-[HITEMP-2010]_ (typically T < 2000 K) or [CDSD-4000]_ (T < 5000 K). These databases must be described in a ``~/.radis``
+[HITEMP-2010]_ (typically T < 2000 K) or [CDSD-4000]_ (T < 5000 K). These databases must be described in a ``~/radis.json``
 :ref:`Configuration file <label_lbl_config_file>`.
 
 .. note::
diff --git a/docs/lbl/databases.rst b/docs/lbl/databases.rst
index acdb0bcb2..74d10c9b7 100644
--- a/docs/lbl/databases.rst
+++ b/docs/lbl/databases.rst
@@ -37,7 +37,7 @@ RADIS can read files from the HITEMP database.
 - HITEMP-2010 files can be downloaded from https://hitran.org/hitemp/. Expect
   ~3 Gb for CO2 or ~10 Gb for H2O. Cite with [HITEMP-2010]_
 
-The ``~/.radis`` is then used to properly handle the line databases
+The ``~/radis.json`` is then used to properly handle the line databases
 on the User environment. See the :ref:`Configuration file <label_lbl_config_file>` section, as well as
 the :py:mod:`radis.misc.config` module and the :py:func:`~radis.misc.config.getDatabankList`
 function for more information.
@@ -75,9 +75,9 @@ downloaded manually.
   [CDSD-4000]_ FTP : ftp://ftp.iao.ru/pub/CDSD-4000/  . They can be loaded and interpolated
   with :py:class:`~radis.levels.partfunc_cdsd.PartFuncCO2_CDSDtab`. This can be done automatically
   providing ``parfuncfmt: cdsd`` and ``parfunc = PATH/TO/cdsd_partition_functions.txt`` is given
-  in the ``~/.radis`` configuration file (see the :ref:`Configuration file <label_lbl_config_file>`).
+  in the ``~/radis.json`` configuration file (see the :ref:`Configuration file <label_lbl_config_file>`).
 
-The ``~/.radis`` is  used to properly handle the line databases
+The ``~/radis.json`` is  used to properly handle the line databases
 on the User environment. See the :ref:`Configuration file <label_lbl_config_file>` section, as well as
 the :py:mod:`radis.misc.config` module and the :py:func:`~radis.misc.config.getDatabankList`
 function for more information.
diff --git a/docs/lbl/lbl.rst b/docs/lbl/lbl.rst
index 570fb4996..5359f46b8 100644
--- a/docs/lbl/lbl.rst
+++ b/docs/lbl/lbl.rst
@@ -340,7 +340,7 @@ and :py:mod:`~astropy.units` ::
                          cutoff=1e-25,              # cm/molecule
                          broadening_max_width=10,   # cm-1
                          )
-    sf.load_databank('HITRAN-CO2-TEST')        # this database must be defined in ~/.radis
+    sf.load_databank('HITRAN-CO2-TEST')        # this database must be defined in ~/radis.json
     s1 = sf.eq_spectrum(Tgas=300 * u.K)
     s2 = sf.eq_spectrum(Tgas=2000 * u.K)
     s3 = sf.non_eq_spectrum(Tvib=2000 * u.K, Trot=300 * u.K)
@@ -350,7 +350,7 @@ and :py:mod:`~astropy.units` ::
 Configuration file
 ------------------
 
-The ``~/.radis`` configuration file is used to store the list and attributes of the Line databases
+The ``~/radis.json`` configuration file is used to store the list and attributes of the Line databases
 available on your computer.
 
 Without a configuration file, you can still:
@@ -373,83 +373,106 @@ A configuration file will help to:
     format, and partition function format directly, but this is not recommended and should only be used if for some
     reason you cannot create a configuration file.
 
-A ``~/.radis`` is user-dependant, and machine-dependant. It contains a list of database, everyone of which
+A ``~/radis.json`` is user-dependant, and machine-dependant. It contains a list of database, everyone of which
 is specific to a given molecule. It typically looks like::
 
-str: Typical expected format of a ~/.radis entry::
-
-    [MY-HITEMP-CO2]                  #  your databank name: use this in calc_spectrum()
-                                     #  or SpectrumFactory.load_databank()
-    path =                           #  no "", multipath allowed
-           D:\Databases\HITEMP-CO2\hitemp_07
-           D:\Databases\HITEMP-CO2\hitemp_08
-           D:\Databases\HITEMP-CO2\hitemp_09
-    format = hitran                  #  'hitran' (HITRAN/HITEMP), 'cdsd-hitemp', 'cdsd-4000'
-                                     # databank text file format. More info in
-                                     # SpectrumFactory.load_databank function.
-    parfuncfmt = hapi                # calculate partition functions
+str: Typical expected format of a ~/radis.json entry::
+
+    {
+      "database": {                                     # database key: all databanks information are stored in this key
+          "MY-HITEMP-CO2": {                            # your databank name: use this in calc_spectrum()
+                                                        # or SpectrumFactory.load_databank()
+            "path": [                                   # no "", multipath allowed
+                "D:\\Databases\\HITEMP-CO2\\hitemp_07",
+                "D:\\Databases\\HITEMP-CO2\\hitemp_08",
+                "D:\\Databases\\HITEMP-CO2\\hitemp_09"
+            ],
+            "format": "hitran",                         # 'hitran' (HITRAN/HITEMP), 'cdsd-hitemp', 'cdsd-4000'
+                                                        # databank text file format. More info in
+                                                        # SpectrumFactory.load_databank function.
+            "parfuncfmt": "hapi"                        # calculate partition functions
+          }
+      }
+    }
 
 Following is an example where the path variable uses a wildcard ``*`` to find all the files that have ``hitemp_*`` in their names::
 
-	[MY-HITEMP-CO2]                  #  your databank name: use this in calc_spectrum()
-	                                 #  or SpectrumFactory.load_databank()
-	path =  D:\Databases\HITEMP-CO2\hitemp_*    # To load all hitemp files directly
-	format = hitran                  #  'hitran' (HITRAN/HITEMP), 'cdsd-hitemp', 'cdsd-4000'
-	                                 # databank text file format. More info in
-	                                 # SpectrumFactory.load_databank function.
-	parfuncfmt = hapi                # calculate partition functions
+    {
+      "database": {                                     # database key: all databanks information are stored in this key
+          "MY-HITEMP-CO2": {                            # your databank name: use this in calc_spectrum()
+                                                        # or SpectrumFactory.load_databank()
+            "path": "D:\\Databases\\HITEMP-CO2\\hitemp_*",   # To load all hitemp files directly
+            "format": "hitran",                         # 'hitran' (HITRAN/HITEMP), 'cdsd-hitemp', 'cdsd-4000'
+                                                        # databank text file format. More info in
+                                                        # SpectrumFactory.load_databank function.
+            "parfuncfmt": "hapi"                        # calculate partition functions
+          }
+      }
+    }
 
 
 In the former example, for equilibrium calculations, RADIS uses [HAPI]_ to retrieve
 partition functions tabulated with TIPS-2017. It is also possible to use your own
 partition functions, for instance::
 
-    [MY-HITEMP-CO2]                  #  your databank name: use this in calc_spectrum()
-                                     #  or SpectrumFactory.load_databank()
-    path =                           #  no "", multipath allowed
-           D:\Databases\HITEMP-CO2\hitemp_07
-           D:\Databases\HITEMP-CO2\hitemp_08
-           D:\Databases\HITEMP-CO2\hitemp_09
-    format = hitran                  #  'hitran' (HITRAN/HITEMP), 'cdsd-hitemp', 'cdsd-4000'
-                                     # databank text file format. More info in
-                                     # SpectrumFactory.load_databank function.
-    parfuncfmt: cdsd                 #  'cdsd', 'hapi', etc.
-                                     # format to read tabulated partition function
-                                     # file. If `hapi`, then HAPI (HITRAN Python
-                                     # interface) is used to retrieve them (valid if
-                                     # your databank is HITRAN data). HAPI is embedded
-                                     # into RADIS. Check the version. If not specified then 'hapi'
-                                     # is used as default
-    parfunc = PATH/TO/cdsd_partition_functions.txt
-                                     #  path to tabulated partition function to use.
-                                     # If `parfuncfmt` is `hapi` then `parfunc`
-                                     # should be the link to the hapi.py file. If
-                                     # not given, then the hapi.py embedded in RADIS
-                                     # is used (check version)
+    {
+      "database": {                                       # database key: all databanks information are stored in this key
+          "MY-HITEMP-CO2": {                              # your databank name: use this in calc_spectrum()
+                                                          # or SpectrumFactory.load_databank()
+            "path": [                                     # no "", multipath allowed
+                "D:\\Databases\\HITEMP-CO2\\hitemp_07",
+                "D:\\Databases\\HITEMP-CO2\\hitemp_08",
+                "D:\\Databases\\HITEMP-CO2\\hitemp_09"
+            ],
+            "format": "hitran",                           # 'hitran' (HITRAN/HITEMP), 'cdsd-hitemp', 'cdsd-4000'
+                                                          # databank text file format. More info in
+                                                          # SpectrumFactory.load_databank function.
+            "parfuncfmt": "cdsd",                         # 'cdsd', 'hapi', etc.
+                                                          # format to read tabulated partition function
+                                                          # file. If `hapi`, then HAPI (HITRAN Python
+                                                          # interface) is used to retrieve them (valid if
+                                                          # your databank is HITRAN data). HAPI is embedded
+                                                          # into RADIS. Check the version. If not specified then 'hapi'
+                                                          # is used as default
+            "parfunc": "PATH/TO/cdsd_partition_functions.txt"
+                                                          # path to tabulated partition function to use.
+                                                          # If `parfuncfmt` is `hapi` then `parfunc`
+                                                          # should be the link to the hapi.py file. If
+                                                          # not given, then the hapi.py embedded in RADIS
+                                                          # is used (check version)
+          }
+      }
+    }
 
 By default, for nonequilibrium calculations, RADIS built-in :ref:`spectroscopic constants <label_db_spectroscopic_constants>`
 are used to calculate the energy levels for CO2.
 It is also possible to use your own Energy level database. For instance::
 
 
-    [MY-HITEMP-CO2]                  #  your databank name: use this in calc_spectrum()
-                                     #  or SpectrumFactory.load_databank()
-    path =                           #  no "", multipath allowed
-           D:\Databases\HITEMP-CO2\hitemp_07
-           D:\Databases\HITEMP-CO2\hitemp_08
-           D:\Databases\HITEMP-CO2\hitemp_09
-    format = hitran                  #  'hitran' (HITRAN/HITEMP), 'cdsd-hitemp', 'cdsd-4000'
-                                     # databank text file format. More info in
-                                     # SpectrumFactory.load_databank function.
-                                     # is used (check version)
-    levels_iso1 = D:\PATH_TO\energies_of_626_isotope.levels
-    levels_iso2 = D:\PATH_TO\energies_of_636_isotope.levels
-    levelsfmt = cdsd                 #  'cdsd', etc.
-                                     # how to read the previous file. Default None.
-    levelsZPE = 2531.828             #  zero-point-energy (cm-1): offset for all level
-                                     # energies. Default 0 (if not given)
-
-The full description of a `~/.radis` entry is given in :py:data:`~radis.misc.config.DBFORMAT`:
+    {
+      "database": {                                        # database key: all databanks information are stored in this key
+          "MY-HITEMP-CO2": {                               # your databank name: use this in calc_spectrum()
+                                                           # or SpectrumFactory.load_databank()
+            "path": [                                      # no "", multipath allowed
+                "D:\\Databases\\HITEMP-CO2\\hitemp_07",
+                "D:\\Databases\\HITEMP-CO2\\hitemp_08",
+                "D:\\Databases\\HITEMP-CO2\\hitemp_09"
+            ],
+            "format": "hitran",                             # 'hitran' (HITRAN/HITEMP), 'cdsd-hitemp', 'cdsd-4000'
+                                                            # databank text file format. More info in
+                                                            # SpectrumFactory.load_databank function.
+                                                            # is used (check version)
+            "levels_iso1": "D:\\PATH_TO\\energies_of_626_isotope.levels",
+            "levels_iso2": "D:\\PATH_TO\\energies_of_636_isotope.levels",
+            "levelsfmt": "cdsd",                            # 'cdsd', etc.
+                                                            # how to read the previous file. Default None.
+            "levelszpe": "2531.828"                         # zero-point-energy (cm-1): offset for all level
+                                                            # energies. Default 0 (if not given)
+          }
+      }
+    }
+
+The full description of a `~/radis.json` entry is given in :py:data:`~radis.misc.config.DBFORMAT`:
 
 - ``path`` corresponds to Line databases (here: downloaded from [HITEMP-2010]_) and the ``levels_iso``
   are user generated Energy databases (here: calculated from the [CDSD-4000]_ Hamiltonian on non-distributed code,
@@ -477,37 +500,40 @@ The full description of a `~/.radis` entry is given in :py:data:`~radis.misc.con
 
 *How to create the configuration file?*
 
-A default ``~/.radis`` configuration file can be generated with :py:func:`~radis.test.utils.setup_test_line_databases`, which
+A default ``~/radis.json`` configuration file can be generated with :py:func:`~radis.test.utils.setup_test_line_databases`, which
 creates two test databases from fragments of [HITRAN-2016]_ line databases::
 
     from radis.test.utils import setup_test_line_databases
     setup_test_line_databases()
 
-which will create a ``~/.radis`` file with the following content ::
-
-
-    [HITRAN-CO2-TEST]
-    info = HITRAN 2016 database, CO2, 1 main isotope (CO2-626), bandhead: 2380-2398 cm-1 (4165-4200 nm)
-    path = PATH_TO\radis\radis\test\files\hitran_co2_626_bandhead_4165_4200nm.par
-    format = hitran
-    parfuncfmt = hapi
-    levelsfmt = radis
-
-
-    [HITRAN-CO-TEST]
-    info = HITRAN 2016 database, CO, 3 main isotopes (CO-26, 36, 28), 2000-2300 cm-1
-    path = PATH_TO\radis\radis\test\files\hitran_co_3iso_2000_2300cm.par
-    format = hitran
-    parfuncfmt = hapi
-    levelsfmt = radis
-
-
-    [HITEMP-CO2-TEST]
-    info = HITEMP-2010, CO2, 3 main isotope (CO2-626, 636, 628), 2283.7-2285.1 cm-1
-    path = PATH_TO\radis\radis\test\files\cdsd_hitemp_09_fragment.txt
-    format = cdsd-hitemp
-    parfuncfmt = hapi
-    levelsfmt = radis
+which will create a ``~/radis.json`` file with the following content ::
+
+
+    {
+      "database": {
+          "HITRAN-CO2-TEST": {
+            "info": "HITRAN 2016 database, CO2, 1 main isotope (CO2-626), bandhead: 2380-2398 cm-1 (4165-4200 nm)",
+            "path": "PATH_TO\\radis\\radis\\test\\files\\hitran_co2_626_bandhead_4165_4200nm.par",
+            "format": "hitran",
+            "parfuncfmt": "hapi",
+            "levelsfmt": "radis"
+          },
+          "HITRAN-CO-TEST": {
+            "info": "HITRAN 2016 database, CO, 3 main isotopes (CO-26, 36, 28), 2000-2300 cm-1",
+            "path": "PATH_TO\\radis\\radis\\test\\files\\hitran_co_3iso_2000_2300cm.par",
+            "format": "hitran",
+            "parfuncfmt": "hapi",
+            "levelsfmt": "radis"
+          },
+          "HITEMP-CO2-TEST": {
+            "info": "HITEMP-2010, CO2, 3 main isotope (CO2-626, 636, 628), 2283.7-2285.1 cm-1",
+            "path": "PATH_TO\\radis\\radis\\test\\files\\cdsd_hitemp_09_fragment.txt",
+            "format": "cdsd-hitemp",
+            "parfuncfmt": "hapi",
+            "levelsfmt": "radis"
+          }
+      }
+    }
 
 
 If you configuration file exists already, the test databases will simply be appended.
diff --git a/radis/__init__.py b/radis/__init__.py
index 9ecd254ed..333f7da58 100644
--- a/radis/__init__.py
+++ b/radis/__init__.py
@@ -78,9 +78,9 @@
 # %% Config files
 
 # @dev: refactor in progress.
-# So far there are config files in ~/.radis (for databanks), global variables
+# So far there are config files in ~/radis.json (for databanks), global variables
 # here, and a radis/config.json file.
-# Everything should be merged in a user JSON file ~/.radis (json) overriding
+# Everything should be merged in a user JSON file ~/radis.json (json) overriding
 # the default one.
 
 config = get_config()
@@ -90,9 +90,9 @@
 -----
 
 refactor in progress.
-So far there are config files in ~/.radis (for databanks), global variables
+So far there are config files in ~/radis.json (for databanks), global variables
 here, and a radis/config.json file.
-Everything should be merged in a user JSON file ~/.radis (json) overriding
+Everything should be merged in a user JSON file ~/radis.json (json) overriding
 the default one.
 """
 
diff --git a/radis/io/hitemp.py b/radis/io/hitemp.py
index 24cff5389..39f386897 100644
--- a/radis/io/hitemp.py
+++ b/radis/io/hitemp.py
@@ -198,7 +198,7 @@ def fetch_hitemp(
             metadata_is={},
             metadata_keys_contain=["wavenumber_min", "wavenumber_max"],
         )
-        # check database is registered in ~/.radis
+        # check database is registered in ~/radis.json
         if not databank_name in getDatabankList():
             # if not, check number of rows is correct :
             error_msg = ""
@@ -366,7 +366,7 @@ def fetch_hitemp(
                 + "Else it may be a download error ?"
             )
 
-    # Add database to  ~/.radis
+    # Add database to  ~/radis.json
     register_database(
         databank_name,
         [local_file],
@@ -407,7 +407,7 @@ def register_database(
     Parameters
     ----------
     databank_name: str
-        name of the database in :ref:`~/.radis config file <label_lbl_config_file>`
+        name of the database in :ref:`~/radis.json config file <label_lbl_config_file>`
 
     Other Parameters
     ----------------
@@ -416,7 +416,7 @@ def register_database(
     Returns
     -------
     None:
-        adds to :ref:`~/.radis <label_lbl_config_file>` with all the input
+        adds to :ref:`~/radis.json <label_lbl_config_file>` with all the input
         parameters. Also adds ::
 
             format : "hitemp-radisdb"
@@ -443,7 +443,7 @@ def register_database(
         ] += " and RADIS spectroscopic constants for rovibrational energies (nonequilibrium)"
         dict_entries["levelsfmt"] = "radis"
 
-    # Register database in ~/.radis to be able to use it with load_databank()
+    # Register database in ~/radis.json to be able to use it with load_databank()
     try:
         addDatabankEntries(databank_name, dict_entries)
     except DatabaseAlreadyExists as err:
@@ -458,9 +458,9 @@ def register_database(
             # TODO @dev : replace once we have configfile as JSON (https://github.com/radis/radis/issues/167)
         except AssertionError:
             raise DatabaseAlreadyExists(
-                f"{databank_name} already exists in your ~/.radis config file, "
-                + f"with different key `{k}` : `{v}` (~/.radis) ≠ `{dict_entries[k]}` (new). "
-                + "If you're sure of what you're doing, fix the registered database in ~/.radis. "
+                f"{databank_name} already exists in your ~/radis.json config file, "
+                + f"with different key `{k}` : `{v}` (~/radis.json) ≠ `{dict_entries[k]}` (new). "
+                + "If you're sure of what you're doing, fix the registered database in ~/radis.json. "
                 + "Else, remove it from your config file, or choose a different name "
                 + "for the downloaded database with `fetch_hitemp(databank_name=...)`, "
                 + "and restart."
@@ -468,7 +468,7 @@ def register_database(
         else:  # no other error raised
             if verbose:
                 print(
-                    f"{databank_name} already registered in ~/.radis config file, with the same parameters."
+                    f"{databank_name} already registered in ~/radis.json config file, with the same parameters."
                 )
 
 
diff --git a/radis/lbl/calc.py b/radis/lbl/calc.py
index 3418edc2b..a45205f1c 100644
--- a/radis/lbl/calc.py
+++ b/radis/lbl/calc.py
@@ -129,13 +129,13 @@ def calc_spectrum(
         - the name of a a valid database file, in which case the format is inferred.
           For instance, ``'.par'`` is recognized as ``hitran/hitemp`` format.
           Accepts wildcards ``'*'`` to select multiple files.
-        - the name of a spectral database registered in your ``~/.radis``
+        - the name of a spectral database registered in your ``~/radis.json``
           :ref:`configuration file <label_lbl_config_file>`.
           This allows to use multiple database files.
 
         Default ``'hitran'``. See :class:`~radis.lbl.loader.DatabankLoader` for more
         information on line databases, and :data:`~radis.misc.config.DBFORMAT` for
-        your ``~/.radis`` file format.
+        your ``~/radis.json`` file format.
 
         For multiple molecules, use a dictionary with molecule names as keys::
 
@@ -623,14 +623,14 @@ def _is_at_equilibrium():
                 "Couldnt infer the format of the line database file: {0}. ".format(
                     databank
                 )
-                + "Create a user-defined database in your ~/.radis file "
+                + "Create a user-defined database in your ~/radis.json file "
                 + "and define the format there. More information on "
                 + "https://radis.readthedocs.io/en/latest/lbl/lbl.html#configuration-file"
             )
 
         sf.load_databank(**conditions)
 
-    else:  # manual mode: get from user-defined line databases defined in ~/.radis
+    else:  # manual mode: get from user-defined line databases defined in ~/radis.json
         sf.load_databank(
             databank,
             load_energies=not _equilibrium,  # no need to load/calculate energies at eq.
diff --git a/radis/lbl/factory.py b/radis/lbl/factory.py
index 464e0dd59..d849e1ad0 100644
--- a/radis/lbl/factory.py
+++ b/radis/lbl/factory.py
@@ -276,7 +276,7 @@ class SpectrumFactory(BandFactory):
                              medium='vacuum',
                              verbose=1,    # more for more details
                              )
-        sf.load_databank('HITRAN-CO2-TEST')        # predefined in ~/.radis
+        sf.load_databank('HITRAN-CO2-TEST')        # predefined in ~/radis.json
         s = sf.eq_spectrum(Tgas=300 * u.K, path_length=1 * u.cm)
         s.rescale_path_length(0.01)    # cm
         s.plot('radiance_noslit', Iunit='µW/cm2/sr/nm')
diff --git a/radis/lbl/loader.py b/radis/lbl/loader.py
index fe26806de..6067d732c 100644
--- a/radis/lbl/loader.py
+++ b/radis/lbl/loader.py
@@ -671,21 +671,21 @@ def init_databank(self, *args, **kwargs):
 
         Parameters
         ----------
-        name: a section name specified in your ``~/.radis``
+        name: a section name specified in your ``~/radis.json``
             ``.radis`` has to be created in your HOME (Unix) / User (Windows). If
             not ``None``, all other arguments are discarded.
             Note that all files in database will be loaded and it may takes some
             time. Better limit the database size if you already know what
             range you need. See :ref:`Configuration file <label_lbl_config_file>` and
             :data:`~radis.misc.config.DBFORMAT` for expected
-            ``~/.radis`` format
+            ``~/radis.json`` format
 
 
         Other Parameters
         ----------------
         path: str, list of str, None
             list of database files, or name of a predefined database in the
-            :ref:`Configuration file <label_lbl_config_file>` (`~/.radis`)
+            :ref:`Configuration file <label_lbl_config_file>` (`~/radis.json`)
             Accepts wildcards ``*`` to select multiple files
         format: ``'hitran'``, ``'cdsd-hitemp'``, ``'cdsd-4000'``, or any of :data:`~radis.lblinit_databank.loader.KNOWN_DBFORMAT`
             database type. ``'hitran'`` for HITRAN/HITEMP, ``'cdsd-hitemp'``
@@ -1052,7 +1052,7 @@ def load_databank(
     ):
         """Loads databank from shortname in the :ref:`Configuration file.
 
-        <label_lbl_config_file>` (`~/.radis`), or by manually setting all
+        <label_lbl_config_file>` (`~/radis.json`), or by manually setting all
         attributes.
 
         Databank includes:
@@ -1067,21 +1067,21 @@ def load_databank(
 
         Parameters
         ----------
-        name: a section name specified in your ``~/.radis``
+        name: a section name specified in your ``~/radis.json``
             ``.radis`` has to be created in your HOME (Unix) / User (Windows). If
             not ``None``, all other arguments are discarded.
             Note that all files in database will be loaded and it may takes some
             time. Better limit the database size if you already know what
             range you need. See :ref:`Configuration file <label_lbl_config_file>` and
             :data:`~radis.misc.config.DBFORMAT` for expected
-            ``~/.radis`` format
+            ``~/radis.json`` format
 
 
         Other Parameters
         ----------------
         path: str, list of str, None
             list of database files, or name of a predefined database in the
-            :ref:`Configuration file <label_lbl_config_file>` (`~/.radis`)
+            :ref:`Configuration file <label_lbl_config_file>` (`~/radis.json`)
             Accepts wildcards ``*`` to select multiple files
         format: ``'hitran'``, ``'cdsd-hitemp'``, ``'cdsd-4000'``, or any of :data:`~radis.lbl.loader.KNOWN_DBFORMAT`
             database type. ``'hitran'`` for HITRAN/HITEMP, ``'cdsd-hitemp'``
@@ -1255,7 +1255,7 @@ def _check_database_params(
         drop_columns="auto",
     ):
         """Check that database parameters are valid, in particular that paths
-        exist. Loads all parameters if a Database from .radis config file was
+        exist. Loads all parameters if a Database from radis.json config file was
         given.
 
         Returns
@@ -1268,7 +1268,7 @@ def _check_database_params(
         dbformat = format
 
         # Get database format and path
-        # ... either from name (~/.radis config file)
+        # ... either from name (~/radis.json config file)
         if name is not None:
             try:
                 entries = getDatabankEntries(name)
@@ -1301,7 +1301,7 @@ def _check_database_params(
                 raise ValueError(
                     "No database name. Please give a path and a dbformat"
                     + ", or use one of the predefined databases in your"
-                    + " ~/.radis: {0}".format(",".join(dblist))
+                    + " ~/radis.json: {0}".format(",".join(dblist))
                 )
 
         # Check database format
diff --git a/radis/misc/config.py b/radis/misc/config.py
index 4ddc36dce..2d79c4de1 100644
--- a/radis/misc/config.py
+++ b/radis/misc/config.py
@@ -3,12 +3,12 @@
 Summary
 -------
 
-Functions to parse the ``~/.radis`` :ref:`Configuration file <label_lbl_config_file>`
+Functions to parse the ``~/radis.json`` :ref:`Configuration file <label_lbl_config_file>`
 
 Notes
 -----
 
-Create a ~/.radis file in your HOME that contains all machine-specific information
+Create a ~/radis.json file in your HOME that contains all machine-specific information
 (e.g: path to databanks). See :data:`~radis.misc.config.DBFORMAT` for expected
 format
 
@@ -163,17 +163,18 @@ def get_config():
 --------------------------
 
 {
-    "MY-HITEMP-CO2":                 #  your databank name: use this in calc_spectrum()
-    {                            #  or SpectrumFactory.load_databank()
-    "info": "HITEMP 2010 databank",      #  whatever you want
-    "path":                           #  no "", multipath allowed
-        ["D:\Databases\HITEMP-CO2\hitemp_07",
+"database": {                       # database key, stores all databases
+    "MY-HITEMP-CO2": {              # your databank name: use this in calc_spectrum()
+                                    # or SpectrumFactory.load_databank()
+    "info": "HITEMP 2010 databank", # whatever you want
+    "path":                         # no "", multipath allowed
+       ["D:\Databases\HITEMP-CO2\hitemp_07",
         "D:\Databases\HITEMP-CO2\hitemp_08",
         "D:\Databases\HITEMP-CO2\hitemp_09"],
-    "format": "hitran",                  #  'hitran' (HITRAN/HITEMP), 'cdsd-hitemp', 'cdsd-4000'
+    "format": "hitran",             # 'hitran' (HITRAN/HITEMP), 'cdsd-hitemp', 'cdsd-4000'
                                     # databank text file format. More info in
                                     # SpectrumFactory.load_databank function.
-    "parfuncfmt":                      #  'cdsd', 'hapi', etc.
+    "parfuncfmt":                   # 'cdsd', 'hapi', etc.
                                     # format to read tabulated partition function
                                     # file. If `hapi`, then HAPI (HITRAN Python
                                     # interface) is used to retrieve them (valid if
@@ -181,61 +182,63 @@ def get_config():
                                     # into RADIS. Check the version.
     # Optional
     # ----------
-    "parfunc":                         #  path to tabulated partition function to use.
+    "parfunc":                      # path to tabulated partition function to use.
                                     # If `parfuncfmt` is `hapi` then `parfunc`
                                     # should be the link to the hapi.py file. If
                                     # not given, then the hapi.py embedded in RADIS
                                     # is used (check version)
-    "levels_iso1"                      #  path to energy levels (needed for non-eq
+    "levels_iso1":                  # path to energy levels (needed for non-eq
                                     # calculations). Default None
-    "levels_iso2"                     # etc
-    "levels_iso4"                      # etc
-    "levelsfmt":                       #  'cdsd', etc.
+    "levels_iso2":                  # etc
+    "levels_iso4":                  # etc
+    "levelsfmt":                    # 'cdsd', etc.
                                     # how to read the previous file. Default None.
-    "levelsZPE":                     #  zero-point-energy (cm-1): offset for all level
-    }                                # energies. Default 0 (if not given)
+    "levelsZPE":                    # zero-point-energy (cm-1): offset for all level
+    }                               # energies. Default 0 (if not given)
+  }
 }
 
 --------------------------"""
-"""str: Typical expected format of a ~/radis.json entry::
+"""str: Typical expected format of a ~/radis.json entry in "database" key::
 
     --------------------------
 
-    "MY-HITEMP-CO2": {                 #  your databank name: use this in calc_spectrum()
-                                       #  or SpectrumFactory.load_databank()
-    "info": "HITEMP 2010 databank",      #  whatever you want
-    "path":                           #  no "", multipath allowed
-          ["D:\Databases\HITEMP-CO2\hitemp_07"
-           "D:\Databases\HITEMP-CO2\hitemp_08"
-           "D:\Databases\HITEMP-CO2\hitemp_09"],
-    "format": "hitran",                  #  'hitran' (HITRAN/HITEMP), 'cdsd-hitemp', 'cdsd-4000'
-                                     # databank text file format. List of all
-                                     # formats in :py:data:`~radis.lbl.loader.KNOWN_DBFORMAT`
-                                     # More info in
-                                     # :py:meth:`~radis.lbl.loader.DatabankLoader.load_databank` function.
-    "parfuncfmt":                      #  'cdsd', 'hapi', etc.
-                                     # format to read tabulated partition function
-                                     # file. If `hapi`, then HAPI (HITRAN Python
-                                     # interface) is used to retrieve them (valid if
-                                     # your databank is HITRAN data). HAPI is embedded
-                                     # into RADIS. Check the version.
-                                     # List of all formats in :py:data:`~radis.lbl.loader.KNOWN_LVLFORMAT`
+    "MY-HITEMP-CO2": {              # your databank name: use this in calc_spectrum()
+                                    # or SpectrumFactory.load_databank()
+    "info": "HITEMP 2010 databank", # whatever you want
+    "path":[                        # no "", multipath allowed
+        "D:\Databases\HITEMP-CO2\hitemp_07"
+        "D:\Databases\HITEMP-CO2\hitemp_08"
+        "D:\Databases\HITEMP-CO2\hitemp_09"
+    ],
+    "format": "hitran",             # 'hitran' (HITRAN/HITEMP), 'cdsd-hitemp', 'cdsd-4000'
+                                    # databank text file format. List of all
+                                    # formats in :py:data:`~radis.lbl.loader.KNOWN_DBFORMAT`
+                                    # More info in
+                                    # :py:meth:`~radis.lbl.loader.DatabankLoader.load_databank` function.
+    "parfuncfmt":                   # 'cdsd', 'hapi', etc.
+                                    # format to read tabulated partition function
+                                    # file. If `hapi`, then HAPI (HITRAN Python
+                                    # interface) is used to retrieve them (valid if
+                                    # your databank is HITRAN data). HAPI is embedded
+                                    # into RADIS. Check the version.
+                                    # List of all formats in :py:data:`~radis.lbl.loader.KNOWN_LVLFORMAT`
     # Optional
     # ----------
-    "parfunc":                         #  path to tabulated partition function to use.
-                                     # If `parfuncfmt` is `hapi` then `parfunc`
-                                     # should be the link to the hapi.py file. If
-                                     # not given, then the hapi.py embedded in RADIS
-                                     # is used (check version)
-    "levels_iso1"                      #  path to energy levels (needed for non-eq
-                                     # calculations). Default None
-    "levels_iso2"                      # etc
-    levels_iso4"                      # etc
-    "levelsfmt":                       #  'cdsd', etc.
-                                     # how to read the previous file. Default None.
-    "levelsZPE":  }                     #  zero-point-energy (cm-1): offset for all level
-                                     # energies. Default 0 (if not given)
-    }
+    "parfunc":                      # path to tabulated partition function to use.
+                                    # If `parfuncfmt` is `hapi` then `parfunc`
+                                    # should be the link to the hapi.py file. If
+                                    # not given, then the hapi.py embedded in RADIS
+                                    # is used (check version)
+    "levels_iso1":                  # path to energy levels (needed for non-eq
+                                    # calculations). Default None
+    "levels_iso2":                  # etc
+    "levels_iso4":                  # etc
+    "levelsfmt":                    # 'cdsd', etc.
+                                    # how to read the previous file. Default None.
+    "levelsZPE":                    # zero-point-energy (cm-1): offset for all level
+    }                               # energies. Default 0 (if not given)
+
     --------------------------
 
 For more information refer to the documentation: :ref:`Configuration file <label_lbl_config_file>` :
@@ -296,11 +299,17 @@ def convertRadisToJSON():
     -----------
     Converted ~/radis.json file format::
 
-        {"HITRAN-CO2-TEST": {"info": "HITRAN 2016 database, CO2, 1 main isotope (CO2-626), bandhead: 2380-2398 cm-1 (4165-4200 nm)",
-        "path": "PATH_TO\\radis\\radis\\test\\files\\hitran_co2_626_bandhead_4165_4200nm.par",
-        "format": "hitran",
-        "parfuncfmt": "hapi",
-        "levelsfmt": "radis"}}
+        {
+        "database": {
+            "HITRAN-CO2-TEST": {
+                "info": "HITRAN 2016 database, CO2, 1 main isotope (CO2-626), bandhead: 2380-2398 cm-1 (4165-4200 nm)",
+                "path": "PATH_TO\\radis\\radis\\test\\files\\hitran_co2_626_bandhead_4165_4200nm.par",
+                "format": "hitran",
+                "parfuncfmt": "hapi",
+                "levelsfmt": "radis"
+            }
+          }
+        }
     """
 
     # Loads configuration file ~/.radis
@@ -723,40 +732,41 @@ def getDatabankEntries(dbname, get_extra_keys=[]):
     -----
     Databank format::
 
-        {
-            "MY-HITEMP-CO2": {                 #  your databank name: use this in calc_spectrum()
-                                            #  or SpectrumFactory.load_databank()
-            "info": "HITEMP 2010 databank"      # whatever you want
-            "path":                           # no "", multipath allowed
-               ["D:\Databases\HITEMP-CO2\hitemp_07"
-                "D:\Databases\HITEMP-CO2\hitemp_08"
-                "D:\Databases\HITEMP-CO2\hitemp_09"]
-            "format": "hitemp"                  # 'hitran' (HITRAN / HITEMP), 'cdsd-hitemp', 'cdsd-4000'
-                                            # Databank text file format. More info in
-                                            # SpectrumFactory.load_databank function.
-
-            # Optional:
-
-            "parfunc"                          # path or 'USE_HAPI'
-                                            # path to tabulated partition functions. If
-                                            # `USE_HAPI`, then HAPI (HITRAN Python
-                                            interface) [1]_ is used to retrieve them (valid
-                                            if your databank is HITRAN data). HAPI
-                                            is embedded into RADIS. Check the version.
-
-            "parfuncfmt"                      # 'cdsd'
-                                            # format to read tabulated partition function
-                                            # file. If `USE_HAPI` is given as `parfunc`
-                                            # parameter then this line should not be used.
-
-            "levels_iso1"                      # path to energy levels (needed for non-eq)
-                                            # calculations.
-            "levels_iso2"                      # etc
-            "levels_iso4"                      # etc
-
-            "levelsfmt"                        # 'cdsd'
-            }                               # how to read the previous file.
-        }
+        "MY-HITEMP-CO2": {              # your databank name: use this in calc_spectrum()
+                                        # or SpectrumFactory.load_databank()
+        "info": "HITEMP 2010 databank"  # whatever you want
+        "path": [                       # no "", multipath allowed
+            "D:\Databases\HITEMP-CO2\hitemp_07",
+            "D:\Databases\HITEMP-CO2\hitemp_08",
+            "D:\Databases\HITEMP-CO2\hitemp_09"
+        ],
+        "format": "hitemp"              # 'hitran' (HITRAN / HITEMP), 'cdsd-hitemp', 'cdsd-4000'
+                                        # Databank text file format. More info in
+                                        # SpectrumFactory.load_databank function.
+
+        # Optional:
+
+        "parfunc":                      # path or 'USE_HAPI'
+                                        # path to tabulated partition functions. If
+                                        # `USE_HAPI`, then HAPI (HITRAN Python
+                                        interface) [1]_ is used to retrieve them (valid
+                                        if your databank is HITRAN data). HAPI
+                                        is embedded into RADIS. Check the version.
+
+        "parfuncfmt":                   # 'cdsd'
+                                        # format to read tabulated partition function
+                                        # file. If `USE_HAPI` is given as `parfunc`
+                                        # parameter then this line should not be used.
+
+        "levels_iso1":                  # path to energy levels (needed for non-eq)
+                                        # calculations.
+        "levels_iso2":                  # etc
+        "levels_iso4":                  # etc
+
+        "levelsfmt":                    # 'cdsd'
+        }                               # how to read the previous file.
+
+
 
     References
     ----------
diff --git a/setup.cfg b/setup.cfg
index 3a60edbd0..1c6c36007 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,14 +1,14 @@
 [tool:pytest]
 markers =
     fast: this tests runs within a few seconds (deselect with '-m "not fast"')
-    needs_config_file: requires a ~/.radis configuration file (deselect with '-m "not needs_config_file"')
+    needs_config_file: requires a ~/radis.json configuration file (deselect with '-m "not needs_config_file"')
     needs_connection: requires an internet connection (deselect with '-m "not needs_connection"')
     download_large_databases: requires to download a large (usually HITEMP) database (deactivated by default. Select with '-m "download_large_databases"')
-    needs_db_CDSD_HITEMP: requires the CDSD-HITEMP line database defined in ~/.radis (deactivated by default. Select with '-m "needs_db_CDSD_HITEMP"')
-    needs_db_CDSD_HITEMP_PCN: requires the CDSD-HITEMP line database with PCN nonequilibrium scheme defined in ~/.radis (deactivated by default. Select with '-m "needs_db_CDSD_HITEMP_PCN"')
-    needs_db_CDSD_HITEMP_PC: requires the CDSD-HITEMP line database with PC nonequilibrium scheme defined in ~/.radis (deactivated by default. Select with '-m "needs_db_CDSD_HITEMP_PC"')
-    needs_db_HITEMP_CO2_DUNHAM: requires the HITEMP_CO2_DUNHAM line database with defined in ~/.radis (deactivated by default. Select with '-m "needs_db_HITEMP_CO2_DUNHAM"')
-    needs_db_HITEMP_CO_DUNHAM: requires the HITEMP_CO_DUNHAM line database with defined in ~/.radis (deactivated by default. Select with '-m "needs_db_HITEMP_CO_DUNHAM"')
+    needs_db_CDSD_HITEMP: requires the CDSD-HITEMP line database defined in ~/radis.json (deactivated by default. Select with '-m "needs_db_CDSD_HITEMP"')
+    needs_db_CDSD_HITEMP_PCN: requires the CDSD-HITEMP line database with PCN nonequilibrium scheme defined in ~/radis.json (deactivated by default. Select with '-m "needs_db_CDSD_HITEMP_PCN"')
+    needs_db_CDSD_HITEMP_PC: requires the CDSD-HITEMP line database with PC nonequilibrium scheme defined in ~/radis.json (deactivated by default. Select with '-m "needs_db_CDSD_HITEMP_PC"')
+    needs_db_HITEMP_CO2_DUNHAM: requires the HITEMP_CO2_DUNHAM line database with defined in ~/radis.json (deactivated by default. Select with '-m "needs_db_HITEMP_CO2_DUNHAM"')
+    needs_db_HITEMP_CO_DUNHAM: requires the HITEMP_CO_DUNHAM line database with defined in ~/radis.json (deactivated by default. Select with '-m "needs_db_HITEMP_CO_DUNHAM"')
 addopts = -m "not needs_cuda and not download_large_databases and not needs_db_CDSD_HITEMP and not needs_db_CDSD_HITEMP_PCN and not needs_db_CDSD_HITEMP_PC and not needs_db_HITEMP_CO2_DUNHAM and not needs_db_HITEMP_CO_DUNHAM"
 
 [isort]


Test patch:
diff --git a/docs/dev/test.rst b/docs/dev/test.rst
index cb822529f..6d24882c8 100644
--- a/docs/dev/test.rst
+++ b/docs/dev/test.rst
@@ -74,14 +74,14 @@ The list of tags is:
 - fast : each test should run under 1s
 - needs_connection : requires an internet connection
 - needs_python3 : a Python-3 only test
-- needs_config_file: needs ``~/.radis`` to be defined.
+- needs_config_file: needs ``~/radis.json`` to be defined.
 
 Plus some tags for user-defined [HITEMP-2010]_ databases, as given in the :ref:`Configuration file <label_lbl_config_file>`
 section
 
-- needs_db_HITEMP_CO2_DUNHAM : requires HITEMP-CO2-DUNHAM database in ``~/.radis``
-- needs_db_HITEMP_CO_DUNHAM : requires HITEMP-CO-DUNHAM database in ``~/.radis``
-- needs_db_CDSD_HITEMP_PC : requires CDSD-HITEMP-PC database in ``~/.radis``
+- needs_db_HITEMP_CO2_DUNHAM : requires HITEMP-CO2-DUNHAM database in ``~/radis.json``
+- needs_db_HITEMP_CO_DUNHAM : requires HITEMP-CO-DUNHAM database in ``~/radis.json``
+- needs_db_CDSD_HITEMP_PC : requires CDSD-HITEMP-PC database in ``~/radis.json``
 
 The default test routine run on `Travis CI <https://travis-ci.com/radis/radis>`__
 is (see the ``radis/.gitlab-ci.yml`` file)::
diff --git a/radis/test/files/generate_test_files.py b/radis/test/files/generate_test_files.py
index eeaa95a8d..b939b1e22 100644
--- a/radis/test/files/generate_test_files.py
+++ b/radis/test/files/generate_test_files.py
@@ -16,7 +16,7 @@
 
     from radis import SpectrumFactory
 
-    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/.radis if not there
+    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/radis.json if not there
 
     Tgas = 1500
     sf = SpectrumFactory(
diff --git a/radis/test/io/test_hitemp.py b/radis/test/io/test_hitemp.py
index 4c4a02bbf..dba7c94e2 100644
--- a/radis/test/io/test_hitemp.py
+++ b/radis/test/io/test_hitemp.py
@@ -162,7 +162,7 @@ def test_calc_hitemp_CO_noneq(verbose=True, *args, **kwargs):
         isotope="1,2",
         Tvib=1500,
         Trot=300,
-        databank="HITEMP-CO",  # registered in ~/.radis
+        databank="HITEMP-CO",  # registered in ~/radis.json
     )
 
 
diff --git a/radis/test/io/test_hitran_cdsd.py b/radis/test/io/test_hitran_cdsd.py
index 7955dba9f..ebed71833 100644
--- a/radis/test/io/test_hitran_cdsd.py
+++ b/radis/test/io/test_hitran_cdsd.py
@@ -223,7 +223,7 @@ def _run_example(verbose=False):
 
     setup_test_line_databases(
         verbose=verbose
-    )  # add HITEMP-CO2-TEST in ~/.radis if not there
+    )  # add HITEMP-CO2-TEST in ~/radis.json if not there
     sf = SpectrumFactory(
         wavelength_min=4165,
         wavelength_max=4200,
@@ -236,7 +236,7 @@ def _run_example(verbose=False):
         verbose=verbose,
     )
     sf.warnings["MissingSelfBroadeningWarning"] = "ignore"
-    sf.load_databank("HITRAN-CO2-TEST")  # this database must be defined in ~/.radis
+    sf.load_databank("HITRAN-CO2-TEST")  # this database must be defined in ~/radis.json
 
 
 def test_cache_regeneration(verbose=True, warnings=True, **kwargs):
diff --git a/radis/test/lbl/test_base.py b/radis/test/lbl/test_base.py
index ca3ead2ae..e8af220bc 100644
--- a/radis/test/lbl/test_base.py
+++ b/radis/test/lbl/test_base.py
@@ -31,7 +31,7 @@ def test_populations(plot=True, verbose=True, warnings=True, *args, **kwargs):
     if verbose:
         printm(">>> _test_media_line_shift")
 
-    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/.radis if not there
+    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/radis.json if not there
 
     sf = SpectrumFactory(
         wavelength_min=4500,
@@ -107,7 +107,7 @@ def test_populations_CO2_hamiltonian(
     if verbose:
         printm(">>> _test_media_line_shift")
 
-    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/.radis if not there
+    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/radis.json if not there
 
     sf = SpectrumFactory(
         wavenum_min=2283.7,
diff --git a/radis/test/lbl/test_broadening.py b/radis/test/lbl/test_broadening.py
index 5b315f025..5105551d5 100644
--- a/radis/test/lbl/test_broadening.py
+++ b/radis/test/lbl/test_broadening.py
@@ -36,7 +36,7 @@ def test_broadening_vs_hapi(rtol=1e-2, verbose=True, plot=False, *args, **kwargs
     if plot:  # Make sure matplotlib is interactive so that test are not stuck in pytest
         plt.ion()
 
-    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/.radis if not there
+    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/radis.json if not there
 
     # Conditions
     T = 3000
@@ -135,7 +135,7 @@ def test_broadening_methods_different_conditions(
     if plot:  # Make sure matplotlib is interactive so that test are not stuck in pytest
         plt.ion()
 
-    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/.radis if not there
+    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/radis.json if not there
 
     # Conditions
     wstep = 0.005
@@ -224,7 +224,7 @@ def test_broadening_methods_different_wstep(verbose=True, plot=False, *args, **k
     if plot:  # Make sure matplotlib is interactive so that test are not stuck in pytest
         plt.ion()
 
-    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/.radis if not there
+    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/radis.json if not there
 
     # Conditions
     T = 3000
@@ -294,7 +294,7 @@ def test_broadening_DLM(verbose=True, plot=False, *args, **kwargs):
     if plot:  # Make sure matplotlib is interactive so that test are not stuck in pytest
         plt.ion()
 
-    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/.radis if not there
+    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/radis.json if not there
 
     # Conditions
     T = 3000
@@ -370,7 +370,7 @@ def test_broadening_DLM_FT(verbose=True, plot=False, *args, **kwargs):
     if plot:  # Make sure matplotlib is interactive so that test are not stuck in pytest
         plt.ion()
 
-    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/.radis if not there
+    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/radis.json if not there
 
     # Conditions
     T = 3000
@@ -443,7 +443,7 @@ def test_broadening_DLM_noneq(verbose=True, plot=False, *args, **kwargs):
     if plot:  # Make sure matplotlib is interactive so that test are not stuck in pytest
         plt.ion()
 
-    setup_test_line_databases()  # add HITRAN-CO2-TEST in ~/.radis if not there
+    setup_test_line_databases()  # add HITRAN-CO2-TEST in ~/radis.json if not there
 
     # Conditions
     p = 1
diff --git a/radis/test/lbl/test_factory.py b/radis/test/lbl/test_factory.py
index f0a7ea484..c2e4db15c 100644
--- a/radis/test/lbl/test_factory.py
+++ b/radis/test/lbl/test_factory.py
@@ -294,7 +294,7 @@ def test_power_integral(verbose=True, warnings=True, *args, **kwargs):
     if verbose:
         printm(">>> _test_power_integral")
 
-    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/.radis if not there
+    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/radis.json if not there
 
     sf = SpectrumFactory(
         wavelength_min=4300,
@@ -354,7 +354,7 @@ def test_media_line_shift(plot=False, verbose=True, warnings=True, *args, **kwar
     if verbose:
         printm(">>> _test_media_line_shift")
 
-    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/.radis if not there
+    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/radis.json if not there
 
     sf = SpectrumFactory(
         wavelength_min=4500,
@@ -408,7 +408,7 @@ def test_media_line_shift(plot=False, verbose=True, warnings=True, *args, **kwar
 def test_wavelength_units_conversion(
     input_wavelengths, expected_wavelengths_nm, verbose=True, *args, **kwargs
 ):
-    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/.radis if not there
+    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/radis.json if not there
 
     wlmin, wlmax = input_wavelengths
     expected_wlmin, expected_wlmax = expected_wavelengths_nm
@@ -439,7 +439,7 @@ def test_wavelength_units_conversion(
 def test_wavenumber_units_conversion(
     input_wavenumbers, expected_wavenumbers_cm1, verbose=True, *args, **kwargs
 ):
-    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/.radis if not there
+    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/radis.json if not there
 
     wmin, wmax = input_wavenumbers
     expected_wmin, expected_wmax = expected_wavenumbers_cm1
@@ -472,7 +472,7 @@ def test_wavenumber_units_conversion(
 def test_pressure_units_conversion(
     input_pressure, expected_pressure_bar, verbose=True, *args, **kwargs
 ):
-    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/.radis if not there
+    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/radis.json if not there
 
     sf = SpectrumFactory(
         wavelength_min=4300,
@@ -503,7 +503,7 @@ def test_pressure_units_conversion(
 def test_pathlength_units_conversion(
     input_pathlength, expected_pathlength_cm, verbose=True, *args, **kwargs
 ):
-    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/.radis if not there
+    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/radis.json if not there
 
     sf = SpectrumFactory(
         wavelength_min=4300,
@@ -533,7 +533,7 @@ def test_pathlength_units_conversion(
 def test_temperature_units_conversion(
     input_temperature, expected_temperature_K, verbose=True, *args, **kwargs
 ):
-    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/.radis if not there
+    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/radis.json if not there
 
     sf = SpectrumFactory(
         wavelength_min=4300,
diff --git a/radis/test/lbl/test_loader.py b/radis/test/lbl/test_loader.py
index f03d3b1f0..56b1fdde2 100644
--- a/radis/test/lbl/test_loader.py
+++ b/radis/test/lbl/test_loader.py
@@ -38,7 +38,7 @@ def test_retrieve_from_database(
 
         assert not exists(temp_database_name)
 
-        setup_test_line_databases()  # add HITEMP-CO2-TEST in ~/.radis if not there
+        setup_test_line_databases()  # add HITEMP-CO2-TEST in ~/radis.json if not there
 
         sf = SpectrumFactory(
             2284.2,
diff --git a/radis/test/lbl/test_spectrum.py b/radis/test/lbl/test_spectrum.py
index 409e847fd..a3ce1a70a 100644
--- a/radis/test/lbl/test_spectrum.py
+++ b/radis/test/lbl/test_spectrum.py
@@ -91,7 +91,7 @@ def test_rescaling_path_length(
 
     from radis.lbl import SpectrumFactory
 
-    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/.radis if not there
+    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/radis.json if not there
 
     Tgas = 1500
     sf = SpectrumFactory(
@@ -147,7 +147,7 @@ def test_rescaling_mole_fraction(
     if plot:  # Make sure matplotlib is interactive so that test are not stuck
         plt.ion()
 
-    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/.radis if not there
+    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/radis.json if not there
 
     Tgas = 1500
     sf = SpectrumFactory(
@@ -206,7 +206,7 @@ def test_medium(plot=False, verbose=True, debug=False, warnings=True, *args, **k
 
     T = 300
 
-    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/.radis if not there
+    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/radis.json if not there
 
     pl = SpectrumFactory(
         wavenum_min=2171.5,
diff --git a/radis/test/levels/test_partfunc.py b/radis/test/levels/test_partfunc.py
index 9ce850b02..0b52b8f92 100644
--- a/radis/test/levels/test_partfunc.py
+++ b/radis/test/levels/test_partfunc.py
@@ -693,7 +693,7 @@ def run_example():
 
         setup_test_line_databases(
             verbose=True
-        )  # add HITEMP-CO2-HAMIL-TEST in ~/.radis if not there
+        )  # add HITEMP-CO2-HAMIL-TEST in ~/radis.json if not there
 
         sf = SpectrumFactory(
             wavenum_min=2283.7,
diff --git a/radis/test/misc/test_arrays.py b/radis/test/misc/test_arrays.py
index 55431518e..eb3958fa0 100644
--- a/radis/test/misc/test_arrays.py
+++ b/radis/test/misc/test_arrays.py
@@ -197,7 +197,7 @@ def test_cython_add_at_spectra(*args, **kwargs):
     with numpy add.at().
     """
 
-    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/.radis if not there
+    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/radis.json if not there
 
     # Conditions
     wstep = 0.005
diff --git a/radis/test/misc/test_config.py b/radis/test/misc/test_config.py
index 8ff505002..8efa0413a 100644
--- a/radis/test/misc/test_config.py
+++ b/radis/test/misc/test_config.py
@@ -19,7 +19,7 @@ def test_json_config_file(*args, **kwargs):
 
 @pytest.mark.fast
 def test_databanks(*args, **kwargs):
-    """ Test .radis is readable """
+    """ Test radis.json is readable """
     printDatabankList()
 
 
diff --git a/radis/test/tools/test_slit.py b/radis/test/tools/test_slit.py
index e844cf1df..a15e4eb64 100644
--- a/radis/test/tools/test_slit.py
+++ b/radis/test/tools/test_slit.py
@@ -678,7 +678,7 @@ def test_resampling(rtol=1e-2, verbose=True, plot=True, warnings=True, *args, **
     if plot:  # Make sure matplotlib is interactive so that test are not stuck in pytest
         plt.ion()
 
-    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/.radis if not there
+    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/radis.json if not there
 
     plCO = SpectrumFactory(
         wavenum_min=2230,
diff --git a/radis/test/utils.py b/radis/test/utils.py
index 7ca5bf072..5a038c6bb 100644
--- a/radis/test/utils.py
+++ b/radis/test/utils.py
@@ -206,7 +206,7 @@ def testEqual(a, b, info=""):
 
 def setup_test_line_databases(verbose=True):
     """Build :py:data:`~radis.test.utils.TEST_DATABASES` and add them in
-    ~/.radis. Generate the file if it  doesnt exist.
+    ~/radis.json. Generate the file if it  doesnt exist.
 
     In particular:
 
@@ -219,7 +219,7 @@ def setup_test_line_databases(verbose=True):
 
     These test databases are used to run the different test routines. They can
     obviously be used by Users to run simulations, but we suggest Users to download
-    their own line databases files and add them to ~/.radis so they have more control
+    their own line databases files and add them to ~/radis.json so they have more control
     on it
 
     Examples
@@ -247,13 +247,12 @@ def setup_test_line_databases(verbose=True):
         from radis.misc.config import printDatabankEntries
         printDatabankEntries('HITEMP-CO2-TEST')
 
-        >>> HITEMP-CO2-TEST
-        >>> -------
-        >>> info : HITEMP-2010, CO2, 3 main isotope (CO2-626, 636, 628), 2283.7-2285.1 cm-1
-        >>> path : ['/USER/PATH/TO\\radis\\radis\\test\\files\\cdsd_hitemp_09_fragment.txt']
-        >>> format : cdsd-hitemp
-        >>> parfuncfmt : hapi
-        >>> levelsfmt : radis
+        >>> 'HITEMP-CO2-TEST':
+        >>> {'info': 'HITEMP-2010, CO2, 3 main isotope (CO2-626, 636, 628), 2283.7-2285.1 cm-1',
+        >>> 'path': ['/USER/PATH/TO\\radis\\radis\\test\\files\\cdsd_hitemp_09_fragment.txt'],
+        >>> 'format': 'cdsd-hitemp'
+        >>> 'parfuncfmt': 'hapi'
+        >>> 'levelsfmt': 'radis'
 
 
     See Also
@@ -283,17 +282,17 @@ def setup_test_line_databases(verbose=True):
             if diff is not None:
                 raise ValueError(
                     "{0}".format(diff)
-                    + "\nIn ~/.radis\n----------\n{0}".format(
+                    + "\nIn ~/radis.json\n----------\n{0}".format(
                         getDatabankEntries(dbname)
                     )
                     + "\n\nExpected\n---------\n{0}\n\n".format(dbentries)
                     + "Test Database {0} doesnt match expected ".format(dbname)
                     + "entries for key `{0}`. See comparison above. ".format(diff)
                     + "To regenerate test databases just delete the {0} ".format(dbname)
-                    + "entry in your ~/.radis"
+                    + "entry in your ~/radis.json"
                 )
 
-        else:  # add them (create ~/.radis file if doesnt exist yet)
+        else:  # add them (create ~/radis.json file if doesnt exist yet)
             addDatabankEntries(dbname, dbentries)
 
     return
diff --git a/radis/test/validation/test_RADIS_vs_HAPI_line_broadening.py b/radis/test/validation/test_RADIS_vs_HAPI_line_broadening.py
index 830ab6062..4d398e63a 100644
--- a/radis/test/validation/test_RADIS_vs_HAPI_line_broadening.py
+++ b/radis/test/validation/test_RADIS_vs_HAPI_line_broadening.py
@@ -48,7 +48,7 @@ def test_line_broadening(rtol=1e-3, verbose=True, plot=False, *args, **kwargs):
         transmittanceSpectrum,
     )
 
-    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/.radis if not there
+    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/radis.json if not there
 
     # Conditions
     molecule = "CO2"
diff --git a/radis/test/validation/test_validation_vs_specair_noneqCO.py b/radis/test/validation/test_validation_vs_specair_noneqCO.py
index e0933a36a..2f67723cb 100644
--- a/radis/test/validation/test_validation_vs_specair_noneqCO.py
+++ b/radis/test/validation/test_validation_vs_specair_noneqCO.py
@@ -32,7 +32,7 @@ def test_validation_vs_specair(rtol=1e-2, verbose=True, plot=False, *args, **kwa
 
     """
 
-    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/.radis if not there
+    setup_test_line_databases()  # add HITRAN-CO-TEST in ~/radis.json if not there
 
     # %% Specair calculation
     # -----------