Skip to content

Commit 4e6ea37

Browse files
committed
2 parents abaeed9 + 6295c8a commit 4e6ea37

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

tracklib/core/track.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,12 +1166,15 @@ def createAnalyticalFeature(self, name, val_init=0.0):
11661166
Initialise tous les obs.
11671167
"""
11681168
if name == None:
1169-
return
1169+
raise AnalyticalFeatureError("Error: can't add AF '" + name + "', name is required")
11701170
Track.__controlName(name)
1171+
11711172
if self.size() <= 0:
11721173
raise AnalyticalFeatureError("Error: can't add AF '" + name + "', there is no observation in track")
11731174
if self.hasAnalyticalFeature(name):
1175+
# raise AnalyticalFeatureError("Error: can't add AF '" + name + "', name already exists.")
11741176
return
1177+
11751178
idAF = len(self.__analyticalFeaturesDico)
11761179
self.__analyticalFeaturesDico[name] = idAF
11771180
if isinstance(val_init, list):
@@ -1181,7 +1184,6 @@ def createAnalyticalFeature(self, name, val_init=0.0):
11811184
for i in range(self.size()):
11821185
self.getObs(i).features.append(val_init)
11831186

1184-
11851187
def updateAnalyticalFeature(self, name, new_val):
11861188
"""
11871189
Update values of an AF.

tracklib/io/track_reader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def readFromFile(path, track_format:Union[str, TrackFormat]="DEFAULT", verbose=F
120120
fmt.controlFormat()
121121

122122
if verbose:
123-
print("Loading track(s) ...")
123+
print("The input format is valid. Loading track(s) ...")
124124

125125
if os.path.isdir(path):
126126
TRACES = TrackCollection()
@@ -175,7 +175,7 @@ def readFromFile(path, track_format:Union[str, TrackFormat]="DEFAULT", verbose=F
175175

176176

177177
@staticmethod
178-
def __readFromCsv(path: str, fmt:TrackFormat, verbose) -> Union(Track, TrackCollection): # type: ignore
178+
def __readFromCsv(path: str, fmt:TrackFormat, verbose) -> Union(Track, TrackCollection):
179179
"""
180180
Read track(s) from CSV file(s) with geometry structured in coordinates.
181181

0 commit comments

Comments
 (0)