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
wtlib
WindEnergyToolbox
Commits
e64d0076
Commit
e64d0076
authored
6 years ago
by
David Verelst
Browse files
Options
Downloads
Patches
Plain Diff
revert previous commit, debugging why test on runner is not passing
parent
8a5c9d5b
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
wetb/prepost/hawcstab2.py
+4
-4
4 additions, 4 deletions
wetb/prepost/hawcstab2.py
wetb/prepost/tests/test_hawcstab2.py
+4
-0
4 additions, 0 deletions
wetb/prepost/tests/test_hawcstab2.py
with
8 additions
and
4 deletions
wetb/prepost/hawcstab2.py
+
4
−
4
View file @
e64d0076
...
...
@@ -31,7 +31,7 @@ class dummy(object):
regex_units
=
re
.
compile
(
'
(
\\
[.*?
\\
])
'
)
def
ReadFileHAWCStab2Header
(
fname
,
dtype
=
None
):
def
ReadFileHAWCStab2Header
(
fname
):
"""
Read a file with a weird HAWCStab2 header that starts with a #, and
includes the column number and units between square brackets.
...
...
@@ -79,7 +79,7 @@ def ReadFileHAWCStab2Header(fname, dtype=None):
# and another with frozen wake assumption
columns
=
get_col_names
(
line_header
,
colwidths
)
df
=
pd
.
read_fwf
(
fname
,
widths
=
colwidths
,
comment
=
'
#
'
,
header
=
None
,
names
=
columns
,
dtype
=
dtype
)
names
=
columns
)
units
=
regex_units
.
findall
(
''
.
join
(
columns
))
return
df
,
units
...
...
@@ -155,8 +155,8 @@ class results(object):
return
res
def
load_pwr_df
(
self
,
fname
,
dtype
=
None
):
return
ReadFileHAWCStab2Header
(
fname
,
dtype
=
dtype
)
def
load_pwr_df
(
self
,
fname
):
return
ReadFileHAWCStab2Header
(
fname
)
def
load_cmb
(
self
,
fname
):
# aero-(servo)-elastic results for HS2>=2.14 have real_eig as 3th set
...
...
This diff is collapsed.
Click to expand it.
wetb/prepost/tests/test_hawcstab2.py
+
4
−
0
View file @
e64d0076
...
...
@@ -121,6 +121,10 @@ class Tests(unittest.TestCase):
df_data
,
units
=
res
.
load_pwr_df
(
fname
,
dtype
=
np
.
float32
)
data
=
np
.
loadtxt
(
fname
,
dtype
=
np
.
float32
)
self
.
assertEqual
(
data
.
shape
,
df_data
.
shape
)
print
(
data
.
dtype
)
print
(
data
.
values
.
dtype
)
print
(
data
)
print
(
data
.
values
)
np
.
testing
.
assert_almost_equal
(
data
,
df_data
.
values
,
decimal
=
6
)
...
...
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