pathpy / pathpyG

GPU-accelerated Next-Generation Network Analytics and Graph Learning for Time Series Data on Complex Networks.
https://www.pathpy.net
GNU Affero General Public License v3.0
33 stars 3 forks source link

229 enhance config handling #237

Closed hackl closed 4 days ago

hackl commented 1 week ago

Chang the config to a toml based format. Now the config can be found in pathpyG.toml. This config file can be updated, added and overwritten by a local pathpyG.toml file in the working directory.

toml syntax for the config file can be found here: https://toml.io/en/

NOTE: tomllib is only natively supported by Python 3.11 upwards. Until the python version is changed, a workaround for older versions is implemented based on https://github.com/hukkin/tomli

import sys

if sys.version_info >= (3, 11):
    import tomllib
else:
    import tomli as tomllib

tomllib.loads("['This parses fine with Python 3.6+']")