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
cb1c771c
Commit
cb1c771c
authored
3 years ago
by
Florian Obersteiner
Browse files
Options
Downloads
Patches
Plain Diff
bugfix of the bugfix - should really write tests first
parent
0f96aa79
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!11
__version__ from package metadata
Pipeline
#23
passed
3 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/icartt/dataset.py
+8
-4
8 additions, 4 deletions
src/icartt/dataset.py
with
8 additions
and
4 deletions
src/icartt/dataset.py
+
8
−
4
View file @
cb1c771c
...
...
@@ -214,10 +214,14 @@ class KeywordComment:
class
StandardNormalComments
(
collections
.
UserList
):
@property
def
nlines
(
self
):
n
=
1
# shortnames line, and keywords might be multiline...
n
+=
len
(
self
.
freeform
)
n
+=
sum
(
len
(
k
.
data
[
0
].
split
(
"
\n
"
))
or
1
for
k
in
self
.
keywords
.
values
())
# was: len(self.freeform) + 1 + sum([len(k.data) for k in self.keywords.values()])
"""
calculates the number of lines in the normal comments section
"""
n
=
1
# shortnames line
n
+=
len
(
self
.
freeform
)
# freeform comment
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
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