Commit f141048d authored by Cresson Remi's avatar Cresson Remi
Browse files

REFAC: use os.path.join() instead of system.pathify()

1 merge request!6Checkpoints callbacks fixes
Pipeline #36531 failed with stages
in 7 minutes and 53 seconds
Showing with 5 additions and 5 deletions
+5 -5
...@@ -44,12 +44,12 @@ class TFRecords: ...@@ -44,12 +44,12 @@ class TFRecords:
if system.is_dir(path) or not os.path.exists(path): if system.is_dir(path) or not os.path.exists(path):
self.dirpath = path self.dirpath = path
system.mkdir(self.dirpath) system.mkdir(self.dirpath)
self.tfrecords_pattern_path = "{}*.records".format(system.pathify(self.dirpath)) self.tfrecords_pattern_path = f"{self.dirpath}/*.records"
else: else:
self.dirpath = system.dirname(path) self.dirpath = system.dirname(path)
self.tfrecords_pattern_path = path self.tfrecords_pattern_path = path
self.output_types_file = "{}output_types.json".format(system.pathify(self.dirpath)) self.output_types_file = f"{self.dirpath}/output_types.json"
self.output_shape_file = "{}output_shape.json".format(system.pathify(self.dirpath)) self.output_shape_file = f"{self.dirpath}/output_shape.json"
self.output_shape = self.load(self.output_shape_file) if os.path.exists(self.output_shape_file) else None self.output_shape = self.load(self.output_shape_file) if os.path.exists(self.output_shape_file) else None
self.output_types = self.load(self.output_types_file) if os.path.exists(self.output_types_file) else None self.output_types = self.load(self.output_types_file) if os.path.exists(self.output_types_file) else None
...@@ -99,10 +99,10 @@ class TFRecords: ...@@ -99,10 +99,10 @@ class TFRecords:
else: else:
nb_sample = dataset.size - i * n_samples_per_shard nb_sample = dataset.size - i * n_samples_per_shard
filepath = "{}{}.records".format(system.pathify(self.dirpath), i) filepath = os.path.join(self.dirpath, f"{i}.records")
# Geographic info of all samples of the record # Geographic info of all samples of the record
geojson_path = "{}{}.geojson".format(system.pathify(self.dirpath), i) geojson_path = os.path.join(self.dirpath, f"{i}.geojson")
geojson_dic = {"type": "FeatureCollection", geojson_dic = {"type": "FeatureCollection",
"name": "{}_geoinfo".format(i), "name": "{}_geoinfo".format(i),
"features": []} "features": []}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment