Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dtu-10mw-rwt
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
HAWC Reference Models
dtu-10mw-rwt
Merge requests
!4
Merge debugging changes in make_zip back into develop
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Merge debugging changes in make_zip back into develop
make_zip
into
develop
Overview
0
Commits
4
Pipelines
2
Changes
2
Merged
Jenni Rinker
requested to merge
make_zip
into
develop
4 years ago
Overview
0
Commits
4
Pipelines
2
Changes
2
Expand
0
0
Merge request reports
Compare
develop
version 1
3b111fc6
4 years ago
develop (base)
and
latest version
latest version
07602f5c
4 commits,
4 years ago
version 1
3b111fc6
3 commits,
4 years ago
2 files
+
32
−
18
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
utils/prepare_zip_file.py
+
28
−
16
Options
@@ -4,14 +4,18 @@
import
os
import
shutil
import
subprocess
from
refutils
import
(
turb_to_hs2
,
turb_to_step
,
delete_dlls
,
clone_repo
,
get_repo_info
)
import
sys
from
refutils
import
(
base_to_hs2
,
base_to_step
,
base_to_turb
,
delete_dlls
,
clone_repo
,
get_repo_info
)
if
__name__
==
'
__main__
'
:
# get ref name
ci_ref
=
sys
.
argv
[
1
]
print
(
f
'
Preparing zip file for
{
ci_ref
}
...
'
)
# script inputs
mod_dir
=
'
../dtu-10mw-rwt/
'
# must end with slash
zip_name
=
'
../dtu-10mw-rwt
'
zip_name
=
f
'
../dtu-10mw-rwt
-
{
ci_ref
}
'
basename
=
'
DTU_10MW_RWT
'
dll_git_url
=
'
https://gitlab.windenergy.dtu.dk/OpenLAC/control-binary/control-win32.git
'
dll_branch
=
'
ref_models
'
@@ -23,15 +27,23 @@ if __name__ == '__main__':
# ======= make hawcstab2 and step-wind files =======
htc_base
=
mod_dir
+
f
'
htc/
{
basename
}
.htc
'
kwargs
=
{}
# default kwargs in functions are for DTU 10 MW, no need to update
kwargs
=
dict
(
pitch_f
=
100
,
pitch_z
=
0.7
,
cut_in
=
4
,
cut_out
=
25
,
n_wsp
=
22
,
gen_min
=
299.85
,
gen_max
=
479.56567
,
gbr
=
50
,
pitch_min
=
0
,
opt_lambda
=
7.5
,
rate_pow
=
10000
,
gen_eff
=
0.94
,
p1_f
=
0.05
,
p1_z
=
0.7
,
p2_f
=
0.06
,
p2_z
=
0.7
,
gs
=
2
,
constant_power
=
1
,
dt
=
40
,
tstart
=
100
,
wsp
=
24
,
tint
=
0.157
,
tb_wid
=
180
,
tb_ht
=
180
)
# turbulent file
turb_path
=
mod_dir
+
f
'
htc/
{
basename
}
_turb.htc
'
base_to_turb
(
htc_base
,
turb_path
,
**
kwargs
)
# hawcstab2
hs2_path
=
mod_dir
+
f
'
{
basename
}
_hs2.htc
'
turb
_to_hs2
(
htc_base
,
hs2_path
,
**
kwargs
)
base
_to_hs2
(
htc_base
,
hs2_path
,
**
kwargs
)
# step wind
step_path
=
mod_dir
+
f
'
htc/
{
basename
}
_step.htc
'
turb
_to_step
(
htc_base
,
step_path
,
**
kwargs
)
base
_to_step
(
htc_base
,
step_path
,
**
kwargs
)
# ======= clone dll repo and copy in the ones we need =======
control_dir
=
mod_dir
+
'
control/
'
# must end with slash!
@@ -50,21 +62,21 @@ if __name__ == '__main__':
for
t
in
dll_list
]
# delete control binaries
shutil
.
rmtree
(
'
./control-win32/
'
)
# doesn't work on WINDOWS >:(
#
shutil.rmtree('./control-win32/') # doesn't work on WINDOWS >:(
#subprocess.run(['rmdir', '/s', '/q', 'control-win32'], shell=True, check=True)
# write the git branch and commit to file
url
,
branch
,
commit
,
date
=
get_repo_info
()
with
open
(
mod_dir
+
'
git_version.txt
'
,
'
w
'
)
as
f
:
f
.
write
(
f
'
Git info for
{
basename
}
zip file
\n
'
)
f
.
write
(
'
------------------------------------
\n
'
)
f
.
write
(
'
Automatically generated using CI on following repo.
\n\n
'
)
f
.
write
(
f
'
Repo url:
{
url
}
\n
'
)
f
.
write
(
f
'
Branch:
{
branch
}
\n
'
)
f
.
write
(
f
'
Commit:
{
commit
}
made on
{
date
}
\n
'
)
#
url, branch, commit, date = get_repo_info()
#
with open(mod_dir + 'git_version.txt', 'w') as f:
#
f.write(f'Git info for {basename} zip file\n')
#
f.write('------------------------------------\n')
#
f.write('Automatically generated using CI on following repo.\n\n')
#
f.write(f'Repo url: {url}\n')
#
f.write(f'Branch: {branch}\n')
#
f.write(f'Commit: {commit} made on {date}\n')
# ======= make the archive =======
shutil
.
make_archive
(
mod_dir
,
'
zip
'
,
zip_name
)
shutil
.
make_archive
(
zip_name
,
'
zip
'
,
mod_dir
)
#%%
\ No newline at end of file
Loading