refactor: remove unused code and files from the project
This commit is contained in:
parent
d03d6500a0
commit
c885cf989b
16
app.py
16
app.py
@ -1,16 +0,0 @@
|
|||||||
"""
|
|
||||||
Created on Fri Apr 21 2023
|
|
||||||
@name: app.py
|
|
||||||
@desc: Main file for the application
|
|
||||||
@auth: Djalim Simaila
|
|
||||||
@e-mail: djalim.simaila@inrae.fr
|
|
||||||
"""
|
|
||||||
import sys
|
|
||||||
from PyQt5.QtWidgets import QApplication
|
|
||||||
from utils.gui.pyqt.main_window.MainWindow import MainWindow
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
app = QApplication(sys.argv)
|
|
||||||
window = MainWindow()
|
|
||||||
window.show()
|
|
||||||
app.exec()
|
|
||||||
75
main.py
75
main.py
@ -1,61 +1,16 @@
|
|||||||
from utils.data_processing.data_processing import get_discrete_data, get_raw_data
|
"""
|
||||||
from utils.files import output
|
Created on Fri Apr 21 2023
|
||||||
from utils.files.input import ScannedObject
|
@name: app.py
|
||||||
from utils.math.position_manipulation import verticalise
|
@desc: Main file for the application
|
||||||
import time
|
@auth: Djalim Simaila
|
||||||
|
@e-mail: djalim.simaila@inrae.fr
|
||||||
|
"""
|
||||||
|
import sys
|
||||||
|
from PyQt5.QtWidgets import QApplication
|
||||||
|
from utils.gui.pyqt.main_window.MainWindow import MainWindow
|
||||||
|
|
||||||
def main():
|
if __name__ == "__main__":
|
||||||
# Create an object from the given file
|
app = QApplication(sys.argv)
|
||||||
total_time = time.time()
|
window = MainWindow()
|
||||||
print("Loading file...")
|
window.show()
|
||||||
t = time.time()
|
app.exec()
|
||||||
obj = ScannedObject.from_obj_file("datasets/Barette/1 - BARETTE.obj")
|
|
||||||
print("File loaded in {} seconds".format(time.time()-t))
|
|
||||||
t = time.time()
|
|
||||||
print("Verticalising object...")
|
|
||||||
verticalise(obj)
|
|
||||||
print("Object verticalised in {} seconds".format(time.time()-t))
|
|
||||||
t = time.time()
|
|
||||||
print("Normalising object...")
|
|
||||||
obj.normalise()
|
|
||||||
print("Object normalised in {} seconds".format(time.time()-t))
|
|
||||||
|
|
||||||
# Calculate raw data and save it in a file
|
|
||||||
t = time.time()
|
|
||||||
data = get_raw_data(obj, 6,2)
|
|
||||||
print("Raw data calculated in {} seconds".format(time.time()-t))
|
|
||||||
t = time.time()
|
|
||||||
print("Saving data...")
|
|
||||||
output.save_output_file('analyse_brute.txt',
|
|
||||||
output.format_data(data,
|
|
||||||
'\t',
|
|
||||||
["X (en mm)",
|
|
||||||
"Y (en mm)",
|
|
||||||
"Z (en mm)",
|
|
||||||
"teta (en rad)",
|
|
||||||
"rayon (en mm)",
|
|
||||||
"Xi-Xmoy",
|
|
||||||
"Yi-Ymoy"] ))
|
|
||||||
print("Data saved in {} seconds".format(time.time()-t))
|
|
||||||
|
|
||||||
# Calculate discrete data and save it in a file
|
|
||||||
t = time.time()
|
|
||||||
print("Calculating discrete data...")
|
|
||||||
data = get_discrete_data(obj, 6,2)
|
|
||||||
print("Discrete data calculated in {} seconds".format(time.time()-t))
|
|
||||||
t = time.time()
|
|
||||||
print("Saving data...")
|
|
||||||
output.save_output_file('analyse_rayon.txt',
|
|
||||||
output.format_data(data,
|
|
||||||
'\t',
|
|
||||||
["X moy (en mm)",
|
|
||||||
"Y moy (en mm)",
|
|
||||||
"Z moy (en mm)",
|
|
||||||
"Discretisation(en mm)",
|
|
||||||
"Rayon moyen (en mm)",
|
|
||||||
"Rayon ecart type (en mm)"] ))
|
|
||||||
print("Data saved in {} seconds".format(time.time()-t))
|
|
||||||
print("Total time : {} seconds".format(time.time()-total_time))
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main()
|
|
||||||
38
test.py
38
test.py
@ -1,38 +0,0 @@
|
|||||||
from utils.files.input import ScannedObject
|
|
||||||
from integration_tests import data_test
|
|
||||||
|
|
||||||
def test_differences():
|
|
||||||
eps = 0.000001
|
|
||||||
obj = ScannedObject.from_xyz_file("datasets/Barette/4 - BARETTE v1.xyz",
|
|
||||||
"datasets/Barette/BARETTE_Delta 1,0_analyse rayon.txt", normalised='z')
|
|
||||||
|
|
||||||
data_test.test_get_raw_data(obj,
|
|
||||||
"datasets/Barette/BARETTE_Delta 1,0_analyse brute.txt",
|
|
||||||
eps=eps)
|
|
||||||
|
|
||||||
data_test.test_get_discrete_data(obj,
|
|
||||||
"datasets/Barette/BARETTE_Delta 1,0_analyse rayon.txt",
|
|
||||||
eps=eps)
|
|
||||||
|
|
||||||
|
|
||||||
def show_diff_two_obj():
|
|
||||||
obj1 = ScannedObject.from_obj_file(
|
|
||||||
"datasets/Barette/3 - BARETTE v1.obj", normalised='z')
|
|
||||||
obj2 = ScannedObject.from_xyz_file(
|
|
||||||
"datasets/Barette/4 - BARETTE v1.xyz", normalised='z')
|
|
||||||
obj2verts = obj2.get_vertices(sort=True)
|
|
||||||
for count, values in enumerate(obj1.get_vertices(sort=True)):
|
|
||||||
L = [abs(values[i] - obj2verts[count][i]) for i in range(len(values))]
|
|
||||||
print(*L, sep="\t")
|
|
||||||
|
|
||||||
|
|
||||||
def count_elements_in_discrete_array():
|
|
||||||
obj = ScannedObject.from_xyz_file("datasets/Barette/4 - BARETTE v1.xyz",
|
|
||||||
"datasets/Barette/BARETTE_Delta 1,0_analyse rayon.txt", normalised='z')
|
|
||||||
cpt = 0
|
|
||||||
for i in obj.bruteforce_discretization():
|
|
||||||
print(f"nb of element in z{cpt} to z{cpt+1}:", len(i))
|
|
||||||
cpt += 1
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
test()
|
|
||||||
Loading…
Reference in New Issue
Block a user