Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
WindEnergyToolbox
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
Container Registry
Model registry
Operate
Environments
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
cmos
WindEnergyToolbox
Commits
1e40c13f
Commit
1e40c13f
authored
6 years ago
by
Emmanuel Branlard
Committed by
Mads M. Pedersen
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ae file with several sets
parent
67b7eba8
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
wetb/hawc2/ae_file.py
+5
-6
5 additions, 6 deletions
wetb/hawc2/ae_file.py
wetb/hawc2/tests/test_ae_file.py
+4
-0
4 additions, 0 deletions
wetb/hawc2/tests/test_ae_file.py
wetb/hawc2/tests/test_files/ae_files/HAWC2_ae.dat
+9
-0
9 additions, 0 deletions
wetb/hawc2/tests/test_files/ae_files/HAWC2_ae.dat
with
18 additions
and
6 deletions
wetb/hawc2/ae_file.py
+
5
−
6
View file @
1e40c13f
...
...
@@ -112,12 +112,11 @@ class AEFile(object):
lptr
=
1
self
.
ae_sets
=
{}
for
_
in
range
(
1
,
nsets
+
1
):
for
_
in
range
(
nsets
):
set_nr
,
n_rows
=
[
int
(
v
)
for
v
in
lines
[
lptr
].
split
()[:
2
]]
lptr
+=
1
data
=
np
.
array
([[
float
(
v
)
for
v
in
l
.
split
()[:
4
]]
for
l
in
lines
[
lptr
:
lptr
+
n_rows
]])
self
.
ae_sets
[
set_nr
]
=
data
lptr
+=
n_rows
set_nr
,
n_rows
=
[
int
(
v
)
for
v
in
lines
[
lptr
].
split
()[:
2
]]
lptr
+=
1
data
=
np
.
array
([[
float
(
v
)
for
v
in
l
.
split
()[:
4
]]
for
l
in
lines
[
lptr
:
lptr
+
n_rows
]])
self
.
ae_sets
[
set_nr
]
=
data
lptr
+=
n_rows
def
main
():
...
...
This diff is collapsed.
Click to expand it.
wetb/hawc2/tests/test_ae_file.py
+
4
−
0
View file @
1e40c13f
...
...
@@ -84,6 +84,10 @@ class TestAEFile(unittest.TestCase):
ae2
=
AEFile
(
fn
)
assert
str
(
ae
)
==
str
(
ae2
)
def
test_multiple_sets
(
self
):
ae
=
AEFile
(
testfilepath
+
'
ae_files/HAWC2_ae.dat
'
)
self
.
assertEqual
(
len
(
ae
.
ae_sets
),
2
)
if
__name__
==
"
__main__
"
:
#import sys;sys.argv = ['', 'Test.testName']
...
...
This diff is collapsed.
Click to expand it.
wetb/hawc2/tests/test_files/ae_files/HAWC2_ae.dat
0 → 100644
+
9
−
0
View file @
1e40c13f
2
1 3
0.0000E+00 5.3800E+00 1.0000E+02 1 ;
2.0000E+00 5.3800E+00 1.0000E+02 1 ;
4.7120E+00 5.3800E+00 9.6915E+01 1 ;
2 3
0.0000E+00 5.3800E+00 1.0000E+02 1 ;
2.0000E+00 5.3800E+00 1.0000E+02 1 ;
4.7120E+00 5.3800E+00 9.6915E+01 1 ;
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