Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Jigyasa Watwani
/
growth-pattern-control
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
162c3a60
authored
Dec 22, 2022
by
Jigyasa Watwani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moving
parent
8ab2655e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
47 deletions
run_fixed_boundaries.py
run_fixed_boundaries.py
deleted
100644 → 0
View file @
8ab2655e
import
datetime
import
json
import
os
import
argparse
from
fixed_boundaries
import
FixedBoundaries
from
viz_fixed_boundaries
import
visualize
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'-j'
,
'--jsonfile'
,
help
=
'json file'
,
default
=
'fixed_boundaries.json'
)
parser
.
add_argument
(
'-t'
,
'--time'
,
help
=
'time to extend'
,
type
=
float
,
default
=
50
)
parser
.
add_argument
(
'-o'
,
'--outputdir'
,
help
=
'output directory'
,
type
=
str
,
default
=
''
)
args
=
parser
.
parse_args
()
assert
os
.
path
.
isfile
(
args
.
jsonfile
),
'
%
s file not found'
%
args
.
jsonfile
with
open
(
args
.
jsonfile
)
as
jsonFile
:
params
=
json
.
load
(
jsonFile
)
u0
,
rho0
,
c0
=
None
,
None
,
None
if
args
.
jsonfile
==
'fixed_boundaries.json'
:
print
(
'Fresh run'
)
extend
=
False
DIR
=
args
.
outputdir
timestamp
=
datetime
.
datetime
.
now
()
.
strftime
(
"
%
d
%
m
%
y-
%
H
%
M
%
S"
)
# current timestamp is the jobID
params
[
'timestamp'
]
=
timestamp
else
:
print
(
'Extending
%
s'
%
params
[
'timestamp'
])
extend
=
True
DIR
=
os
.
path
.
dirname
(
args
.
jsonfile
)
oldMaxTime
=
params
[
'maxtime'
]
params
[
'maxtime'
]
=
args
.
time
# solve
fb
=
FixedBoundaries
(
params
)
fb
.
solve
(
extend
=
extend
,
DIR
=
DIR
)
if
extend
:
params
[
'maxtime'
]
=
oldMaxTime
+
params
[
'maxtime'
]
with
open
(
os
.
path
.
join
(
DIR
,
params
[
'timestamp'
]
+
'_fixed_boundaries.json'
),
"w"
)
as
fp
:
json
.
dump
(
params
,
fp
,
indent
=
4
)
visualize
(
params
,
DIR
,
interactive
=
False
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment