Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
Detection eddies
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Admin message
Gitlab has been updated. More info
here
and
there
.
Show more breadcrumbs
IPSL
LMD
DPAO
Detection eddies
Commits
9d8cc9fd
Commit
9d8cc9fd
authored
2 years ago
by
Lionel GUEZ
Browse files
Options
Downloads
Patches
Plain Diff
Polish
parent
ad73a9ec
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cost_function.py
+5
-5
5 additions, 5 deletions
cost_function.py
segments.py
+1
-7
1 addition, 7 deletions
segments.py
with
6 additions
and
12 deletions
cost_function.py
+
5
−
5
View file @
9d8cc9fd
...
@@ -32,7 +32,7 @@ import bisect
...
@@ -32,7 +32,7 @@ import bisect
def
calculate_radii_and_rossby
(
start
,
end
,
inc
,
segment
,
e_overestim
,
handlers
,
def
calculate_radii_and_rossby
(
start
,
end
,
inc
,
segment
,
e_overestim
,
handlers
,
array_d_init
):
array_d_init
):
radii
=
0
#
[m]
radii
=
0
#
in m
rossby
=
0
rossby
=
0
days_modifier
=
0
days_modifier
=
0
...
@@ -112,7 +112,7 @@ print("Number of edges:", g.num_edges())
...
@@ -112,7 +112,7 @@ print("Number of edges:", g.num_edges())
print
(
"
Internal properties:
"
)
print
(
"
Internal properties:
"
)
g
.
list_properties
()
g
.
list_properties
()
t1
=
time
.
perf_counter
()
t1
=
time
.
perf_counter
()
timings
.
write
(
f
"
loading:
{
t1
-
t0
}
s
\n
"
)
timings
.
write
(
f
"
loading:
{
t1
-
t0
:
.
0
f
}
s
\n
"
)
t0
=
t1
t0
=
t1
g
.
vp
[
'
pos_first
'
]
=
g
.
new_vp
(
'
object
'
)
g
.
vp
[
'
pos_first
'
]
=
g
.
new_vp
(
'
object
'
)
...
@@ -226,7 +226,7 @@ for n in g.vertices():
...
@@ -226,7 +226,7 @@ for n in g.vertices():
g
.
vp
.
last_av_rad
[
n
]
=
radii
g
.
vp
.
last_av_rad
[
n
]
=
radii
t1
=
time
.
perf_counter
()
t1
=
time
.
perf_counter
()
timings
.
write
(
f
"
iterating on vertices:
{
t1
-
t0
}
s
\n
"
)
timings
.
write
(
f
"
iterating on vertices:
{
t1
-
t0
:
.
0
f
}
s
\n
"
)
t0
=
t1
t0
=
t1
print
(
"
Iterating on edges...
"
)
print
(
"
Iterating on edges...
"
)
...
@@ -285,11 +285,11 @@ for edge in g.edges():
...
@@ -285,11 +285,11 @@ for edge in g.edges():
g
.
ep
.
cost_function
[
edge
]
=
cf
g
.
ep
.
cost_function
[
edge
]
=
cf
t1
=
time
.
perf_counter
()
t1
=
time
.
perf_counter
()
timings
.
write
(
f
"
iterating on edges:
{
t1
-
t0
}
s
\n
"
)
timings
.
write
(
f
"
iterating on edges:
{
t1
-
t0
:
.
0
f
}
s
\n
"
)
t0
=
t1
t0
=
t1
print
(
"
Saving...
"
)
print
(
"
Saving...
"
)
g
.
save
(
'
segments_cost_functions.gt
'
)
g
.
save
(
'
segments_cost_functions.gt
'
)
print
(
'
All done
'
)
print
(
'
All done
'
)
t1
=
time
.
perf_counter
()
t1
=
time
.
perf_counter
()
timings
.
write
(
f
"
saving:
{
t1
-
t0
}
s
\n
"
)
timings
.
write
(
f
"
saving:
{
t1
-
t0
:
.
0
f
}
s
\n
"
)
timings
.
close
()
timings
.
close
()
This diff is collapsed.
Click to expand it.
segments.py
+
1
−
7
View file @
9d8cc9fd
...
@@ -13,10 +13,6 @@ import time
...
@@ -13,10 +13,6 @@ import time
import
sys
import
sys
import
pathlib
import
pathlib
##########################
# load the edgelist file #
##########################
if
len
(
sys
.
argv
)
!=
3
:
sys
.
exit
(
"
Required arguments: input-file output-file
"
)
if
len
(
sys
.
argv
)
!=
3
:
sys
.
exit
(
"
Required arguments: input-file output-file
"
)
if
pathlib
.
Path
(
sys
.
argv
[
2
]).
suffix
not
in
{
"
.gt
"
,
"
.graphml
"
}:
if
pathlib
.
Path
(
sys
.
argv
[
2
]).
suffix
not
in
{
"
.gt
"
,
"
.graphml
"
}:
...
@@ -37,9 +33,7 @@ t1 = time.perf_counter()
...
@@ -37,9 +33,7 @@ t1 = time.perf_counter()
print
(
f
'
Loading done in
{
t1
-
t0
:
.
0
f
}
s
'
)
print
(
f
'
Loading done in
{
t1
-
t0
:
.
0
f
}
s
'
)
t0
=
t1
t0
=
t1
##############
# Processing:
# Processing #
##############
g
.
vp
[
'
segment
'
]
=
g
.
new_vp
(
'
object
'
)
# this object will be a list
g
.
vp
[
'
segment
'
]
=
g
.
new_vp
(
'
object
'
)
# this object will be a list
print
(
'
Collapsing into segments...
'
)
print
(
'
Collapsing into segments...
'
)
...
...
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