From baa9d5cb8fa4e35a496d68db5fdaed3ce12a6f0a Mon Sep 17 00:00:00 2001 From: ACornuIGN Date: Fri, 22 Dec 2023 10:54:20 +0100 Subject: [PATCH] build: lint code --- src/reader/manage_reader.py | 7 ++----- src/reader/reader_opk.py | 2 +- src/shot.py | 30 +++++++++++++----------------- src/worksite.py | 6 ++++++ 4 files changed, 22 insertions(+), 23 deletions(-) diff --git a/src/reader/manage_reader.py b/src/reader/manage_reader.py index 41ff8570..236c39b0 100644 --- a/src/reader/manage_reader.py +++ b/src/reader/manage_reader.py @@ -1,9 +1,7 @@ """ Photogrammetry site file reader module """ -import os import importlib -import numpy as np from src.worksite import Worksite @@ -18,8 +16,8 @@ def reader_orientation(file: str, skip: int = None) -> Worksite: Returns: Worksite: The worksite """ - # Todo : Attention multiple file management orientation - # Todo : Attention management of files with the same extension but different formats + # Attention multiple file management orientation + # Attention management of files with the same extension but different formats ext = file.split(".")[-1] try: my_module = importlib.import_module("src.reader.reader_" + ext.lower()) @@ -28,4 +26,3 @@ def reader_orientation(file: str, skip: int = None) -> Worksite: raise ValueError(f"{ext} file is not taken into account !!!") from e return work - diff --git a/src/reader/reader_opk.py b/src/reader/reader_opk.py index da998121..f15c7384 100644 --- a/src/reader/reader_opk.py +++ b/src/reader/reader_opk.py @@ -16,7 +16,7 @@ def read(file: str, skip: int) -> Worksite: Returns: Worksite: The worksite """ - if skip == None: + if skip is None: skip = 1 # Job name retrieval diff --git a/src/shot.py b/src/shot.py index 611df34f..ad790ffc 100644 --- a/src/shot.py +++ b/src/shot.py @@ -1,25 +1,21 @@ """ Acquisition data class module """ +from dataclasses import dataclass import numpy as np - +@dataclass class Shot: """ - Acquisition data class - """ - def __init__(self, name_shot: str, - pos_shot: np.array, ori_shot: np.array, name_cam: str) -> None: - """ - Shot class definition + Shot class definition - Args: - name_shot (str): Name of the shot. - pos_shot (numpy.array): Array of coordinate position [X, Y, Z]. - ori_shot (numpy.array): Array of orientation of the shot [Omega, Phi, Kappa]. - name_cam (str): Name of the camera. - """ - self.name_shot = name_shot - self.pos_shot = pos_shot - self.ori_shot = ori_shot - self.name_cam = name_cam + Args: + name_shot (str): Name of the shot. + pos_shot (numpy.array): Array of coordinate position [X, Y, Z]. + ori_shot (numpy.array): Array of orientation of the shot [Omega, Phi, Kappa]. + name_cam (str): Name of the camera. + """ + name_shot : str + pos_shot : np.array + ori_shot : np.array + name_cam : str diff --git a/src/worksite.py b/src/worksite.py index 838f70e4..c5cb1cbc 100644 --- a/src/worksite.py +++ b/src/worksite.py @@ -35,3 +35,9 @@ def add_shot(self, name_shot: str, pos_shot: np.array, pos_shot=pos_shot, ori_shot=ori_shot, name_cam=name_cam)) + + def add_camera(self): + """ + Add data camera in the Worksite + """ + return 0