Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gext
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michele Nottoli
gext
Commits
9eabda30
Commit
9eabda30
authored
1 year ago
by
Michele Nottoli
Browse files
Options
Downloads
Patches
Plain Diff
Update.
parent
8069bfc3
Branches
Branches containing commit
Tags
Tags containing commit
Loading
Pipeline
#1960
passed
1 year ago
Stage: test
Stage: lint
Stage: coverage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gext/main.py
+7
-0
7 additions, 0 deletions
gext/main.py
with
7 additions
and
0 deletions
gext/main.py
+
7
−
0
View file @
9eabda30
...
...
@@ -25,6 +25,9 @@ class Extrapolator:
def
__init__
(
self
,
nelectrons
:
int
,
nbasis
:
int
,
natoms
:
int
,
**
kwargs
):
if
not
(
type
(
nelectrons
)
==
int
and
type
(
nbasis
)
==
int
and
type
(
natoms
)
==
int
):
raise
ValueError
(
"
Dimensions are not integers
"
)
self
.
nelectrons
=
nelectrons
self
.
nbasis
=
nbasis
self
.
natoms
=
natoms
...
...
@@ -47,6 +50,7 @@ class Extrapolator:
descriptor_options
=
{}
fitting_options
=
{}
# set specified options
for
key
,
value
in
kwargs
.
items
():
if
key
in
self
.
supported_options
:
self
.
options
[
key
]
=
value
...
...
@@ -57,10 +61,13 @@ class Extrapolator:
else
:
raise
ValueError
(
f
"
Unsupported option:
{
key
}
"
)
# set unspecified options with defaults
for
option
,
default_value
in
self
.
supported_options
.
items
():
if
not
option
in
self
.
options
:
self
.
options
[
option
]
=
default_value
# do some check on the options, set things and pipe options
# to submodules
if
self
.
options
[
"
nsteps
"
]
<
1
or
self
.
options
[
"
nsteps
"
]
>=
100
:
raise
ValueError
(
"
Unsupported nsteps
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment