Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NP_TMcode
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Giacomo Mulas
NP_TMcode
Commits
0f2f320c
Commit
0f2f320c
authored
2 months ago
by
Giovanni La Mura
Browse files
Options
Downloads
Patches
Plain Diff
Ensure that random generation parameters are optional
parent
a6d77523
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/scripts/model_maker.py
+6
-3
6 additions, 3 deletions
src/scripts/model_maker.py
with
6 additions
and
3 deletions
src/scripts/model_maker.py
+
6
−
3
View file @
0f2f320c
...
...
@@ -371,9 +371,11 @@ def load_model(model_file):
if
(
len_vec_x
==
0
):
# Generate random cluster
rnd_seed
=
int
(
model
[
'
system_settings
'
][
'
rnd_seed
'
])
try
:
max_rad
=
float
(
model
[
'
particle_settings
'
][
'
max_rad
'
])
# random_aggregate() checks internally whether application is INCLUSION
#random_aggregate(sconf, gconf, rnd_seed, max_rad)
except
KeyError
:
print
(
"
ERROR: random model generation requires specification of particle_settings:max_rad.
"
)
return
(
None
,
None
)
rnd_engine
=
"
COMPACT
"
try
:
rnd_engine
=
model
[
'
system_settings
'
][
'
rnd_engine
'
]
...
...
@@ -386,6 +388,7 @@ def load_model(model_file):
print
(
"
ERROR: compact random generator works only when all sphere types have the same radius.
"
)
return
(
None
,
None
)
elif
(
rnd_engine
==
"
LOOSE
"
):
# random_aggregate() checks internally whether application is INCLUSION
check
=
random_aggregate
(
sconf
,
gconf
,
rnd_seed
,
max_rad
)
else
:
print
(
"
ERROR: unrecognized random generator engine.
"
)
...
...
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