MCPcopy Create free account
hub / github.com/FEniCS/dolfinx / _load_options

Function _load_options

python/dolfinx/jit.py:109–127  ·  view source on GitHub ↗

Loads options from JSON files.

()

Source from the content-addressed store, hash-verified

107
108@functools.cache
109def _load_options():
110 """Loads options from JSON files."""
111 user_config_file = os.getenv("XDG_CONFIG_HOME", default=Path.home().joinpath(".config")) / Path(
112 "dolfinx", "dolfinx_jit_options.json"
113 )
114 try:
115 with open(user_config_file) as f:
116 user_options = json.load(f)
117 except FileNotFoundError:
118 user_options = dict()
119
120 pwd_config_file = Path.cwd().joinpath("dolfinx_jit_options.json")
121 try:
122 with open(pwd_config_file) as f:
123 pwd_options = json.load(f)
124 except FileNotFoundError:
125 pwd_options = dict()
126
127 return (user_options, pwd_options)
128
129
130def get_options(priority_options: dict | None = None) -> dict:

Callers 1

get_optionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected