You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
help="This setting will set Dash's debug mode, will disable the cache used by Crystal Toolkit, and control log output.",
18
+
description="This setting will set Dash's debug mode, will disable the cache used by Crystal Toolkit, and control log output.",
25
19
)
26
20
TEST_MODE: bool=Field(
27
21
default=False,
28
-
help="Set to True when Crytal Toolkit is run during automated testing. It will switch the default renderer to SVG instead of WebGL, since many testing environments do not have WebGL available.",
22
+
description="Set to True when Crytal Toolkit is run during automated testing. It will switch the default renderer to SVG instead of WebGL, since many testing environments do not have WebGL available.",
29
23
)
30
24
31
25
REDIS_URL: RedisDsn|None=Field(
32
26
default="redis://localhost:6379",
33
-
help="Redis instance used by Crystal Toolkit for caching. If set to None, simple caching will be used instead.",
27
+
description="Redis instance used by Crystal Toolkit for caching. If set to None, simple caching will be used instead.",
34
28
)
35
29
ASSETS_PATH: Path=Field(
36
30
default=MODULE_PATH/"apps"/"assets",
37
-
help="Path to assets folder. Used only when running the example Crystal Toolkit apps.",
31
+
description="Path to assets folder. Used only when running the example Crystal Toolkit apps.",
38
32
)
39
33
40
34
PERSISTENCE: bool=Field(
41
35
default=True,
42
-
help="This setting controls whether Crystal Toolkit components in your app will have user-chosen values persisted by default or not. For example, choice of bonding algorithm, etc.",
36
+
description="This setting controls whether Crystal Toolkit components in your app will have user-chosen values persisted by default or not. For example, choice of bonding algorithm, etc.",
help="If set, this CSS file will be loaded by default. Loading Font Awesome is required to display certain icons, but otherwise is not required for functionality.",
54
+
description="If set, this CSS file will be loaded by default. Loading Font Awesome is required to display certain icons, but otherwise is not required for functionality.",
61
55
)
62
56
63
57
JUPYTER_EMBED_PORT: int|None=Field(
64
58
default=8884,
65
-
help="The Jupyter extension (powered by Dash) requires a port to run on. If None, an available port will be chosen.",
59
+
description="The Jupyter extension (powered by Dash) requires a port to run on. If None, an available port will be chosen.",
description="Color scheme used to display atoms.",
76
70
)
77
71
LEGEND_RADIUS_SCHEME: Literal[
78
72
"atomic",
@@ -83,72 +77,75 @@ class Settings(BaseSettings):
83
77
"uniform",
84
78
] =Field(
85
79
default="uniform",
86
-
help="Method with which to choose a radius when displaying atoms.",
80
+
description="Method with which to choose a radius when displaying atoms.",
87
81
)
88
82
LEGEND_CMAP: str=Field(
89
83
default="coolwarm",
90
-
help="Color map for displaying atoms when color-coded by a site property. Choose from matplotlib color maps.",
84
+
description="Color map for displaying atoms when color-coded by a site property. Choose from matplotlib color maps.",
91
85
)
92
86
LEGEND_FALLBACK_COLOR: tuple=Field(
93
87
default=(0, 0, 0),
94
-
help="Fallback color for displaying atoms when a more specific color is not defined.",
88
+
description="Fallback color for displaying atoms when a more specific color is not defined.",
95
89
)
96
90
LEGEND_FALLBACK_RADIUS: float=Field(
97
91
default=1.0,
98
-
help="Fallback radius for displaying atoms when a more specific radius (e.g. ionic radius) is not defined.",
92
+
description="Fallback radius for displaying atoms when a more specific radius (e.g. ionic radius) is not defined.",
99
93
)
100
94
LEGEND_UNIFORM_RADIUS: float=Field(
101
95
default=0.5,
102
-
help="Default radius for displaying atoms when uniform radii are chosen.",
96
+
description="Default radius for displaying atoms when uniform radii are chosen.",
103
97
)
104
98
105
99
# Materials Project API settings.
106
100
# TODO: These should be deprecated in favor of setti
107
-
API_KEY: str|None=Field(default="", help="Materials Project API key.")
101
+
API_KEY: str|None=Field(
102
+
default=os.environ.get("MP_API_KEY"), description="Materials Project API key."
103
+
)
108
104
API_EXTERNAL_ENDPOINT: str=Field(
109
105
default="https://api.materialsproject.org",
110
-
help="Materials Project API endpoint.",
106
+
description="Materials Project API endpoint.",
111
107
)
112
108
113
109
# Materials Project deployment settings. If not running Crystal Toolkit for the Materials Project website, these can be ignored.
114
110
DEV_LOGIN_DISABLED: bool=Field(
115
-
default=True, help="Used internally by Materials Project."
111
+
default=True, description="Used internally by Materials Project."
116
112
)
117
113
LOGIN_ENDPOINT: str=Field(
118
114
default="https://profile.materialsproject.org/",
119
-
help="Used internally by Materials Project.",
115
+
description="Used internally by Materials Project.",
120
116
)
121
117
APP_METADATA: Path=Field(
122
118
default=MODULE_PATH/"apps"/"app_metadata.yaml",
123
-
help="Path to app metadata field for Materials Project apps. Used as an alternative way of defining app metadata when defining many apps.",
119
+
description="Path to app metadata field for Materials Project apps. Used as an alternative way of defining app metadata when defining many apps.",
124
120
)
125
121
126
122
# Experimental settings.
127
123
TRANSFORMATION_PREVIEWS: bool=Field(
128
124
default=False,
129
-
help="This setting controls whether previews are rendered for structure transformations.",
125
+
description="This setting controls whether previews are rendered for structure transformations.",
130
126
)
131
127
DOI_CACHE_PATH: Path|None=Field(
132
128
default=MODULE_PATH/"apps/assets/doi_cache.json",
133
-
help="Not currently used, maybe will be deprecated. This was used to avoid a CrossRef API lookup when a small set of DOIs were used in an app.",
129
+
description="Not currently used, maybe will be deprecated. This was used to avoid a CrossRef API lookup when a small set of DOIs were used in an app.",
134
130
)
135
131
136
132
# Deprecated settings.
137
133
MP_EMBED_MODE: bool=Field(
138
134
default=False,
139
-
help="Deprecated. This was used for early versions of Crystal Toolkit when embedded in the Materials Project website.",
135
+
description="Deprecated. This was used for early versions of Crystal Toolkit when embedded in the Materials Project website.",
0 commit comments