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
5d6ab2ec
Commit
5d6ab2ec
authored
3 years ago
by
Florian Obersteiner
Browse files
Options
Downloads
Patches
Plain Diff
__str__ and __repr__ for dataset and variable classes (unfinished)
parent
21672649
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!6
code refactor
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/icartt/dataset.py
+14
-6
14 additions, 6 deletions
src/icartt/dataset.py
with
14 additions
and
6 deletions
src/icartt/dataset.py
+
14
−
6
View file @
5d6ab2ec
...
...
@@ -308,7 +308,7 @@ class Variable:
:type miss: float, defaults to -99999.0
"""
def
desc
(
self
,
splitChar
=
"
,
"
):
def
desc
(
self
,
splitChar
=
"
,
"
):
"""
Variable description string as it appears in an ICARTT file
:return: description string
...
...
@@ -361,10 +361,12 @@ class Variable:
self
.
scale
=
scale
self
.
miss
=
miss
# TODO: should this also get a __str__ ?
def
__repr__
(
self
):
# TODO: this sould be more meaningful
return
"
ICARTT Variable object repr
"
def
__
rep
r__
(
self
):
# TODO: this could be more meaningful?
return
"
ICARTT Variable description
"
def
__
st
r__
(
self
):
return
self
.
desc
()
class
Dataset
:
...
...
@@ -383,8 +385,6 @@ class Dataset:
:param format:
"""
# TODO: should this also get a __str__ and a __repr__ ?
@property
def
nHeader
(
self
):
"""
Header line count
...
...
@@ -875,6 +875,14 @@ class Dataset:
except
:
pass
def
__repr__
(
self
):
# TODO: this could be more meaningful
return
"
ICARTT Dataset object repr
"
def
__str__
(
self
):
# TODO: this could be more meaningful
return
"
ICARTT Dataset string representation
"
def
__init__
(
self
,
f
=
None
,
loadData
=
True
,
splitChar
=
"
,
"
,
format
=
Formats
.
FFI1001
):
# TODO: why is init comming last?
"""
Constructor method
"""
self
.
format
=
format
...
...
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