Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
ICARTT Python Package
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
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
MBEES
ICARTT Python Package
Commits
f8ea4e0c
Commit
f8ea4e0c
authored
3 years ago
by
Florian Obersteiner
Browse files
Options
Downloads
Patches
Plain Diff
revision of nlines method
parent
970ef9e2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!15
updated normal comments handling
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/icartt/dataset.py
+6
-6
6 additions, 6 deletions
src/icartt/dataset.py
with
6 additions
and
6 deletions
src/icartt/dataset.py
+
6
−
6
View file @
f8ea4e0c
...
...
@@ -189,13 +189,13 @@ class StandardNormalComments(collections.UserList):
@property
def
nlines
(
self
):
"""
calculates the number of lines in the normal comments section
"""
n
=
1
# shortnames line
n
+=
len
(
self
.
freeform
)
# freeform comment
# shortnames line is always there:
n
=
1
# freeform comment might or might not be there:
n
+=
sum
(
len
(
s
.
split
(
'
\n
'
))
for
s
in
self
.
freeform
)
# tagged comments have at least one line:
for
k
in
self
.
keywords
.
values
():
try
:
n
+=
len
(
k
.
data
[
0
].
split
(
"
\n
"
))
# and keywords might be multiline...
except
IndexError
:
# ok we have no list,
n
+=
1
# just add 1
n
+=
sum
(
len
(
s
.
split
(
'
\n
'
))
for
s
in
k
.
data
)
or
1
return
n
@property
...
...
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