Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
u4py
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rudolf, Michael
u4py
Commits
5a31c784
Commit
5a31c784
authored
1 month ago
by
Rudolf, Michael
Browse files
Options
Downloads
Patches
Plain Diff
Fixes #116
parent
3f56dc18
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
u4py/io/docx_report.py
+20
-10
20 additions, 10 deletions
u4py/io/docx_report.py
with
20 additions
and
10 deletions
u4py/io/docx_report.py
+
20
−
10
View file @
5a31c784
...
@@ -5,12 +5,12 @@ requirements of the HLNUG.
...
@@ -5,12 +5,12 @@ requirements of the HLNUG.
import
os
import
os
import
numpy
as
np
import
docx
import
docx
import
docx.parts
import
docx.parts
import
docx.shared
import
docx.shared
import
geopandas
as
gp
import
geopandas
as
gp
import
humanize
import
humanize
import
numpy
as
np
import
uncertainties
as
unc
import
uncertainties
as
unc
from
docx.document
import
Document
from
docx.document
import
Document
from
docx.enum.text
import
WD_ALIGN_PARAGRAPH
from
docx.enum.text
import
WD_ALIGN_PARAGRAPH
...
@@ -115,7 +115,17 @@ def site_report(
...
@@ -115,7 +115,17 @@ def site_report(
document
=
soils
(
img_path
,
img_fmt
,
document
)
document
=
soils
(
img_path
,
img_fmt
,
document
)
FIGURENUM
=
1
FIGURENUM
=
1
# Save to docx file
# Save to docx file
document
.
save
(
os
.
path
.
join
(
output_path_docx
,
f
"
{
group
:
05
}
_info.docx
"
))
mapnums
=
eval
(
row
[
1
].
geology_mapnum
)
if
mapnums
:
docx_path
=
(
os
.
path
.
join
(
output_path_docx
,
f
"
{
str
(
mapnums
)
}
_
{
group
:
05
}
.docx
"
)
.
replace
(
"
[
"
,
""
)
.
replace
(
"
]
"
,
""
)
.
replace
(
"
,
"
,
"
_
"
)
)
else
:
docx_path
=
os
.
path
.
join
(
output_path_docx
,
f
"
XXXX_
{
group
:
05
}
.docx
"
)
document
.
save
(
docx_path
)
def
location
(
series
:
gp
.
GeoSeries
,
document
:
Document
)
->
Document
:
def
location
(
series
:
gp
.
GeoSeries
,
document
:
Document
)
->
Document
:
...
@@ -204,10 +214,7 @@ def hlnug_description(
...
@@ -204,10 +214,7 @@ def hlnug_description(
if
isinstance
(
mapnum
,
list
):
if
isinstance
(
mapnum
,
list
):
mapname
=
eval
(
row
[
"
geology_mapname
"
])
mapname
=
eval
(
row
[
"
geology_mapname
"
])
map_list
=
[
map_list
=
[
f
"
{
mpnum
}
{
mpname
}
"
f
"
{
mpnum
}
{
mpname
}
"
for
mpnum
,
mpname
in
zip
(
mapnum
,
mapname
)
for
mpnum
,
mpname
in
zip
(
mapnum
,
mapname
)
]
]
mapnum_string
=
u4human
.
listed_strings
(
map_list
)
mapnum_string
=
u4human
.
listed_strings
(
map_list
)
prgph
.
add_run
(
f
"
auf den Kartenblättern
{
mapnum_string
}
.
"
)
prgph
.
add_run
(
f
"
auf den Kartenblättern
{
mapnum_string
}
.
"
)
...
@@ -310,7 +317,9 @@ def hlnug_description(
...
@@ -310,7 +317,9 @@ def hlnug_description(
else
:
else
:
prgph
.
add_run
(
"
eine nicht benannte Landstraße.
"
)
prgph
.
add_run
(
"
eine nicht benannte Landstraße.
"
)
else
:
else
:
prgph
.
add_run
(
"
Im Umkreis von 1
\u00a0
km sind keine größeren Straßen vorhanden.
"
)
prgph
.
add_run
(
"
Im Umkreis von 1
\u00a0
km sind keine größeren Straßen vorhanden.
"
)
if
row
[
"
railways_has
"
]:
if
row
[
"
railways_has
"
]:
prgph
.
add_run
(
prgph
.
add_run
(
...
@@ -319,7 +328,8 @@ def hlnug_description(
...
@@ -319,7 +328,8 @@ def hlnug_description(
)
)
elif
row
[
"
railways_close
"
]:
elif
row
[
"
railways_close
"
]:
prgph
.
add_run
(
prgph
.
add_run
(
f
"
Eine Bahnlinie liegt ca.
{
int
(
row
[
'
railways_length
'
])
}
\u00a0
m
"
+
"
entfernt vom Mittelpunkt der Rutschung.
"
f
"
Eine Bahnlinie liegt ca.
{
int
(
row
[
'
railways_length
'
])
}
\u00a0
m
"
+
"
entfernt vom Mittelpunkt der Rutschung.
"
)
)
# Add drill sites
# Add drill sites
...
...
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