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
238ba441
Commit
238ba441
authored
8 years ago
by
mads
Browse files
Options
Downloads
Patches
Plain Diff
apply lower to filenames
parent
266b349f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wetb/hawc2/htc_file.py
+22
-3
22 additions, 3 deletions
wetb/hawc2/htc_file.py
with
22 additions
and
3 deletions
wetb/hawc2/htc_file.py
+
22
−
3
View file @
238ba441
...
@@ -14,8 +14,6 @@ from io import open
...
@@ -14,8 +14,6 @@ from io import open
from
builtins
import
str
from
builtins
import
str
from
future
import
standard_library
from
future
import
standard_library
from
wetb.utils.process_exec
import
pexec
from
wetb.utils.process_exec
import
pexec
from
wetb.gtsdf.unix_time
import
from_unix
standard_library
.
install_aliases
()
standard_library
.
install_aliases
()
from
collections
import
OrderedDict
from
collections
import
OrderedDict
...
@@ -71,7 +69,7 @@ class HTCFile(HTCContents, HTCDefaults):
...
@@ -71,7 +69,7 @@ class HTCFile(HTCContents, HTCDefaults):
def
readfilelines
(
self
,
filename
):
def
readfilelines
(
self
,
filename
):
with
open
(
filename
,
encoding
=
'
cp1252
'
)
as
fid
:
with
open
(
filename
.
lower
()
,
encoding
=
'
cp1252
'
)
as
fid
:
lines
=
list
(
fid
.
readlines
())
lines
=
list
(
fid
.
readlines
())
if
lines
[
0
].
encode
().
startswith
(
b
'
\xc3\xaf\xc2\xbb\xc2\xbf
'
):
if
lines
[
0
].
encode
().
startswith
(
b
'
\xc3\xaf\xc2\xbb\xc2\xbf
'
):
lines
[
0
]
=
lines
[
0
][
3
:]
lines
[
0
]
=
lines
[
0
][
3
:]
...
@@ -255,6 +253,27 @@ class HTCFile(HTCContents, HTCDefaults):
...
@@ -255,6 +253,27 @@ class HTCFile(HTCContents, HTCDefaults):
if
errorcode
or
'
Elapsed time
'
not
in
log
:
if
errorcode
or
'
Elapsed time
'
not
in
log
:
raise
Exception
(
str
(
stdout
)
+
str
(
stderr
))
raise
Exception
(
str
(
stdout
)
+
str
(
stderr
))
class
H2aeroHTCFile
(
HTCFile
):
def
__init__
(
self
,
filename
=
None
,
modelpath
=
"
../
"
):
HTCFile
.
__init__
(
self
,
filename
=
filename
,
modelpath
=
modelpath
)
@property
def
simulation
(
self
):
return
self
.
test_structure
def
set_time
(
self
,
start
=
None
,
stop
=
None
,
step
=
None
):
if
stop
is
not
None
:
self
.
test_structure
.
time_stop
=
stop
else
:
stop
=
self
.
simulation
.
time_stop
[
0
]
if
step
is
not
None
:
self
.
test_structure
.
deltat
=
step
if
start
is
not
None
:
self
.
output
.
time
=
start
,
stop
if
"
wind
"
in
self
and
self
.
wind
.
turb_format
[
0
]
>
0
:
self
.
wind
.
scale_time_start
=
start
if
"
__main__
"
==
__name__
:
if
"
__main__
"
==
__name__
:
f
=
HTCFile
(
r
"
C:\mmpe\HAWC2\models\DTU10MWRef6.0\htc\DTU_10MW_RWT_power_curve.htc
"
,
"
../
"
)
f
=
HTCFile
(
r
"
C:\mmpe\HAWC2\models\DTU10MWRef6.0\htc\DTU_10MW_RWT_power_curve.htc
"
,
"
../
"
)
f
.
save
(
r
"
C:\mmpe\HAWC2\models\DTU10MWRef6.0\htc\DTU_10MW_RWT_power_curve.htc
"
)
f
.
save
(
r
"
C:\mmpe\HAWC2\models\DTU10MWRef6.0\htc\DTU_10MW_RWT_power_curve.htc
"
)
...
...
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