Skip to content

Commit

Permalink
Apply black formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
asidhu0 authored and github-actions[bot] committed Jul 8, 2024
1 parent cea27d6 commit 005a312
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import os
import platform
import re

# import the fuctionality we need to make time stamps to measure performance
import time

Expand Down
2 changes: 1 addition & 1 deletion python/metashape_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
meta = MetashapeWorkflow(config_file)

### Run the Metashape workflow
meta.run()
meta.run()
11 changes: 8 additions & 3 deletions python/metashape_workflow_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import os
import platform
import re

# Import the fuctionality we need to make time stamps to measure performance
import time

Expand Down Expand Up @@ -43,38 +44,44 @@ def convert_objects(a_dict):
else:
convert_objects(v)


def stamp_time():
"""
Format the timestamps as needed
"""
stamp = datetime.datetime.now().strftime("%Y%m%dT%H%M")
return stamp


def diff_time(t2, t1):
"""
Give a end and start time, subtract, and round
"""
total = str(round(t2 - t1, 1))
return total


# Used by add_gcps function
def get_marker(chunk, label):
for marker in chunk.markers:
if marker.label == label:
return marker
return None


# Used by add_gcps function
def get_camera(chunk, label):
for camera in chunk.cameras:
if camera.label.lower() == label.lower():
return camera
return None


# Set the log file name-value separator
# Chose ; as : is in timestamps
# TODO: Consider moving log to json/yaml formatting using a dict


class MetashapeWorkflow:

sep = "; "
Expand Down Expand Up @@ -154,7 +161,6 @@ def run(self):

self.finish_run()


def project_setup(self):
"""
Create output and project paths, if they don't exist
Expand Down Expand Up @@ -236,8 +242,7 @@ def project_setup(self):
)
# write a line with the date and time
file.write(
MetashapeWorkflow.sep.join(["Processing started", stamp_time()])
+ "\n"
MetashapeWorkflow.sep.join(["Processing started", stamp_time()]) + "\n"
)
# write a line with CPU info - if possible, improve the way the CPU info is found / recorded
file.write(MetashapeWorkflow.sep.join(["Node", platform.node()]) + "\n")
Expand Down

0 comments on commit 005a312

Please sign in to comment.