From c91322390a8c48145c64ad9a525f92bb38e77cdf Mon Sep 17 00:00:00 2001 From: Audun Arnesen Nyhus Date: Wed, 15 Feb 2023 13:06:27 +0100 Subject: [PATCH] Minor --- ANYstructure_install.ifp | Bin 3377 -> 3397 bytes MANIFEST.in | 82 ++++++------- README.md | 5 +- __main__.py | 7 +- .../ANYstructure_documentation.pdf | Bin .../SN_curve_parameters.py | 0 {images => any_files}/__init__.py | 0 any_files/__main__.py | 24 ++++ .../bulb_anglebar_tbar_flatbar.csv | 0 calc_loads.py => any_files/calc_loads.py | 0 .../calc_structure.py | 8 +- .../compartment_window.py | 4 +- example_data.py => any_files/example_data.py | 15 ++- .../example_data_puls.py | 0 .../excel_inteface.py | 0 .../fatigue_window.py | 8 +- grid_window.py => any_files/grid_window.py | 5 +- helper.py => any_files/helper.py | 0 .../images}/ANYstructure screenshot.png | Bin .../images}/ANYstructure_logo.jpg | Bin .../images}/Buckling_Strength_of_Shells.png | Bin .../images}/Cylinder-Load_distribution.png | Bin .../Definition_of_parameters_L_and_LH.png | Bin .../images}/Panel_geometry_definitions.png | Bin any_files/images/__init__.py | 0 .../images}/current_comps_NONE.png | Bin {images => any_files/images}/cylinder_opt.png | Bin {images => any_files/images}/fls_button.gif | Bin {images => any_files/images}/img_T_L_FB.gif | Bin .../images}/img_axial_stresses.gif | Bin .../images}/img_dnv_load_combinations.gif | Bin .../images}/img_ext_pressure_button.gif | Bin .../images}/img_ext_pressure_button_def.gif | Bin .../images}/img_fixation_parameters.gif | Bin .../images}/img_generate_report.gif | Bin .../images}/img_int_pressure_button.gif | Bin .../img_int_pressure_button_search.gif | Bin .../images}/img_multi_opt.gif | Bin {images => any_files/images}/img_optimize.gif | Bin .../images}/img_plate_and_stiffener.gif | Bin .../images}/img_stf_button.gif | Bin .../images}/img_stiffened_plate_panel.gif | Bin .../images}/img_stiffener.gif | Bin .../images}/img_stress_button.gif | Bin {images => any_files/images}/img_title.gif | Bin .../images}/img_transverse_stress.gif | Bin .../load_factor_window.py | 0 load_window.py => any_files/load_window.py | 21 ++-- .../main_application.py | 110 +++++++++--------- .../make_grid_numpy.py | 0 make_queue.py => any_files/make_queue.py | 0 make_stack.py => any_files/make_stack.py | 0 .../CL_CSR-Tank_req_cl_UP_scaler.pickle | Bin .../CL_CSR-Tank_req_cl_predictor.pickle | Bin ..._flange_cl,_CSR_flange_cl_SP_scaler.pickle | Bin ..._flange_cl,_CSR_flange_cl_predictor.pickle | Bin ..._predictor_In-plane_support_cl_1_SP.pickle | Bin ..._predictor_In-plane_support_cl_1_UP.pickle | Bin ...edictor_In-plane_support_cl_2,_3_SP.pickle | Bin ...edictor_In-plane_support_cl_2,_3_UP.pickle | Bin ...buc_scaler_In-plane_support_cl_1_SP.pickle | Bin ...buc_scaler_In-plane_support_cl_1_UP.pickle | Bin ..._scaler_In-plane_support_cl_2,_3_SP.pickle | Bin ..._scaler_In-plane_support_cl_2,_3_UP.pickle | Bin ..._predictor_In-plane_support_cl_1_SP.pickle | Bin ..._predictor_In-plane_support_cl_1_UP.pickle | Bin ...edictor_In-plane_support_cl_2,_3_SP.pickle | Bin ...edictor_In-plane_support_cl_2,_3_UP.pickle | Bin ...ult_scaler_In-plane_support_cl_1_SP.pickle | Bin ...ult_scaler_In-plane_support_cl_1_UP.pickle | Bin ..._scaler_In-plane_support_cl_2,_3_SP.pickle | Bin ..._scaler_In-plane_support_cl_2,_3_UP.pickle | Bin opt_problem.py => any_files/opt_problem.py | 0 optimize.py => any_files/optimize.py | 8 +- .../optimize_cylinder.py | 30 +++-- .../optimize_geometry.py | 28 +++-- .../optimize_multiple_window.py | 28 ++--- .../optimize_window.py | 22 ++-- .../pl_stf_window.py | 8 +- .../report_generator.py | 8 +- sections.csv => any_files/sections.csv | 0 .../sesam_interface.py | 8 +- .../ship_section_example.txt | 0 .../stresses_window.py | 4 +- testCalc.py => any_files/testCalc.py | 4 +- setup.py | 11 +- tests/gui_automatic_run.py | 4 +- tests/test_calc_loads_loads.py | 4 +- tests/test_calc_loads_tank.py | 4 +- tests/test_calc_structure_scantlings.py | 4 +- tests/test_calc_structure_structure.py | 4 +- tests/test_calc_strucure_fatigue.py | 4 +- tests/test_grid_operations.py | 4 +- tests/test_make_grid.py | 2 +- tests/test_optimize.py | 4 +- 95 files changed, 253 insertions(+), 229 deletions(-) rename ANYstructure_documentation.pdf => any_files/ANYstructure_documentation.pdf (100%) rename SN_curve_parameters.py => any_files/SN_curve_parameters.py (100%) rename {images => any_files}/__init__.py (100%) create mode 100644 any_files/__main__.py rename bulb_anglebar_tbar_flatbar.csv => any_files/bulb_anglebar_tbar_flatbar.csv (100%) rename calc_loads.py => any_files/calc_loads.py (100%) rename calc_structure.py => any_files/calc_structure.py (99%) rename compartment_window.py => any_files/compartment_window.py (98%) rename example_data.py => any_files/example_data.py (99%) rename example_data_puls.py => any_files/example_data_puls.py (100%) rename excel_inteface.py => any_files/excel_inteface.py (100%) rename fatigue_window.py => any_files/fatigue_window.py (98%) rename grid_window.py => any_files/grid_window.py (99%) rename helper.py => any_files/helper.py (100%) rename {images => any_files/images}/ANYstructure screenshot.png (100%) rename {images => any_files/images}/ANYstructure_logo.jpg (100%) rename {images => any_files/images}/Buckling_Strength_of_Shells.png (100%) rename {images => any_files/images}/Cylinder-Load_distribution.png (100%) rename {images => any_files/images}/Definition_of_parameters_L_and_LH.png (100%) rename {images => any_files/images}/Panel_geometry_definitions.png (100%) create mode 100644 any_files/images/__init__.py rename {images => any_files/images}/current_comps_NONE.png (100%) rename {images => any_files/images}/cylinder_opt.png (100%) rename {images => any_files/images}/fls_button.gif (100%) rename {images => any_files/images}/img_T_L_FB.gif (100%) rename {images => any_files/images}/img_axial_stresses.gif (100%) rename {images => any_files/images}/img_dnv_load_combinations.gif (100%) rename {images => any_files/images}/img_ext_pressure_button.gif (100%) rename {images => any_files/images}/img_ext_pressure_button_def.gif (100%) rename {images => any_files/images}/img_fixation_parameters.gif (100%) rename {images => any_files/images}/img_generate_report.gif (100%) rename {images => any_files/images}/img_int_pressure_button.gif (100%) rename {images => any_files/images}/img_int_pressure_button_search.gif (100%) rename {images => any_files/images}/img_multi_opt.gif (100%) rename {images => any_files/images}/img_optimize.gif (100%) rename {images => any_files/images}/img_plate_and_stiffener.gif (100%) rename {images => any_files/images}/img_stf_button.gif (100%) rename {images => any_files/images}/img_stiffened_plate_panel.gif (100%) rename {images => any_files/images}/img_stiffener.gif (100%) rename {images => any_files/images}/img_stress_button.gif (100%) rename {images => any_files/images}/img_title.gif (100%) rename {images => any_files/images}/img_transverse_stress.gif (100%) rename load_factor_window.py => any_files/load_factor_window.py (100%) rename load_window.py => any_files/load_window.py (98%) rename main_application.py => any_files/main_application.py (99%) rename make_grid_numpy.py => any_files/make_grid_numpy.py (100%) rename make_queue.py => any_files/make_queue.py (100%) rename make_stack.py => any_files/make_stack.py (100%) rename {ml_files => any_files/ml_files}/CL_CSR-Tank_req_cl_UP_scaler.pickle (100%) rename {ml_files => any_files/ml_files}/CL_CSR-Tank_req_cl_predictor.pickle (100%) rename {ml_files => any_files/ml_files}/CL_CSR_plate_cl,_CSR_web_cl,_CSR_web_flange_cl,_CSR_flange_cl_SP_scaler.pickle (100%) rename {ml_files => any_files/ml_files}/CL_CSR_plate_cl,_CSR_web_cl,_CSR_web_flange_cl,_CSR_flange_cl_predictor.pickle (100%) rename {ml_files => any_files/ml_files}/CL_output_cl_buc_predictor_In-plane_support_cl_1_SP.pickle (100%) rename {ml_files => any_files/ml_files}/CL_output_cl_buc_predictor_In-plane_support_cl_1_UP.pickle (100%) rename {ml_files => any_files/ml_files}/CL_output_cl_buc_predictor_In-plane_support_cl_2,_3_SP.pickle (100%) rename {ml_files => any_files/ml_files}/CL_output_cl_buc_predictor_In-plane_support_cl_2,_3_UP.pickle (100%) rename {ml_files => any_files/ml_files}/CL_output_cl_buc_scaler_In-plane_support_cl_1_SP.pickle (100%) rename {ml_files => any_files/ml_files}/CL_output_cl_buc_scaler_In-plane_support_cl_1_UP.pickle (100%) rename {ml_files => any_files/ml_files}/CL_output_cl_buc_scaler_In-plane_support_cl_2,_3_SP.pickle (100%) rename {ml_files => any_files/ml_files}/CL_output_cl_buc_scaler_In-plane_support_cl_2,_3_UP.pickle (100%) rename {ml_files => any_files/ml_files}/CL_output_cl_ult_predictor_In-plane_support_cl_1_SP.pickle (100%) rename {ml_files => any_files/ml_files}/CL_output_cl_ult_predictor_In-plane_support_cl_1_UP.pickle (100%) rename {ml_files => any_files/ml_files}/CL_output_cl_ult_predictor_In-plane_support_cl_2,_3_SP.pickle (100%) rename {ml_files => any_files/ml_files}/CL_output_cl_ult_predictor_In-plane_support_cl_2,_3_UP.pickle (100%) rename {ml_files => any_files/ml_files}/CL_output_cl_ult_scaler_In-plane_support_cl_1_SP.pickle (100%) rename {ml_files => any_files/ml_files}/CL_output_cl_ult_scaler_In-plane_support_cl_1_UP.pickle (100%) rename {ml_files => any_files/ml_files}/CL_output_cl_ult_scaler_In-plane_support_cl_2,_3_SP.pickle (100%) rename {ml_files => any_files/ml_files}/CL_output_cl_ult_scaler_In-plane_support_cl_2,_3_UP.pickle (100%) rename opt_problem.py => any_files/opt_problem.py (100%) rename optimize.py => any_files/optimize.py (99%) rename optimize_cylinder.py => any_files/optimize_cylinder.py (97%) rename optimize_geometry.py => any_files/optimize_geometry.py (99%) rename optimize_multiple_window.py => any_files/optimize_multiple_window.py (99%) rename optimize_window.py => any_files/optimize_window.py (99%) rename pl_stf_window.py => any_files/pl_stf_window.py (99%) rename report_generator.py => any_files/report_generator.py (99%) rename sections.csv => any_files/sections.csv (100%) rename sesam_interface.py => any_files/sesam_interface.py (95%) rename ship_section_example.txt => any_files/ship_section_example.txt (100%) rename stresses_window.py => any_files/stresses_window.py (99%) rename testCalc.py => any_files/testCalc.py (98%) diff --git a/ANYstructure_install.ifp b/ANYstructure_install.ifp index be6b7a79598d3feeda70034c25e2b2dfffc3db05..bc576ec19a8c8b43ceb3397686ea752aab1929af 100644 GIT binary patch delta 39 jcmdlebyR9YJP&7LUS)h*W=?AHqwNYwAJkR7zo?;-@n=Ha>2mncE23!CD diff --git a/MANIFEST.in b/MANIFEST.in index fc1361b..1460a6d 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -5,46 +5,46 @@ include images\fls_button.gif include images\img_axial_stresses.gif include images\img_ext_pressure_button.gif include images\img_ext_pressure_button_def.gif -include images\img_fixation_parameters.gif -include images\img_generate_report.gif -include images\img_int_pressure_button.gif -include images\img_int_pressure_button_search.gif -include images\img_multi_opt.gif -include images\img_optimize.gif -include images\img_plate_and_stiffener.gif -include images\img_stf_button.gif -include images\img_stiffener.gif -include images\img_stress_button.gif -include images\img_T_L_FB.gif -include images\img_title.gif -include images\img_transverse_stress.gif -include images\ANYstructure_logo.jpg -include images\current_comps_NONE.png -include images\Buckling_Strength_of_Shells.png -include images\Panel_geometry_definitions.png -include ship_section_example.txt -include ANYstructure_documentation.pdf -include sections.csv -include bulb_anglebar_tbar_flatbar.csv -include ml_files\CL_output_cl_buc_predictor_In-plane_support_cl_1_SP.pickle -include ml_files\CL_output_cl_buc_scaler_In-plane_support_cl_1_SP.pickle -include ml_files\CL_output_cl_ult_predictor_In-plane_support_cl_1_SP.pickle -include ml_files\CL_output_cl_ult_scaler_In-plane_support_cl_1_SP.pickle -include ml_files\CL_output_cl_buc_predictor_In-plane_support_cl_2,_3_SP.pickle -include ml_files\CL_output_cl_buc_scaler_In-plane_support_cl_2,_3_SP.pickle -include ml_files\CL_output_cl_ult_predictor_In-plane_support_cl_2,_3_SP.pickle -include ml_files\CL_output_cl_ult_scaler_In-plane_support_cl_2,_3_SP.pickle -include ml_files\CL_output_cl_buc_predictor_In-plane_support_cl_1_UP.pickle -include ml_files\CL_output_cl_buc_scaler_In-plane_support_cl_1_UP.pickle -include ml_files\CL_output_cl_ult_predictor_In-plane_support_cl_1_UP.pickle -include ml_files\CL_output_cl_ult_scaler_In-plane_support_cl_1_UP.pickle -include ml_files\CL_output_cl_buc_predictor_In-plane_support_cl_2,_3_UP.pickle -include ml_files\CL_output_cl_buc_scaler_In-plane_support_cl_2,_3_UP.pickle -include ml_files\CL_output_cl_ult_predictor_In-plane_support_cl_2,_3_UP.pickle -include ml_files\CL_output_cl_ult_scaler_In-plane_support_cl_2,_3_UP.pickle -include ml_files\CL_CSR-Tank_req_cl_predictor.pickle -include ml_files\CL_CSR-Tank_req_cl_UP_scaler.pickle -include ml_files\CL_CSR_plate_cl,_CSR_web_cl,_CSR_web_flange_cl,_CSR_flange_cl_predictor.pickle -include ml_files\CL_CSR_plate_cl,_CSR_web_cl,_CSR_web_flange_cl,_CSR_flange_cl_SP_scaler.pickle +include any_files\images\img_fixation_parameters.gif +include any_files\images\img_generate_report.gif +include any_files\images\img_int_pressure_button.gif +include any_files\images\img_int_pressure_button_search.gif +include any_files\images\img_multi_opt.gif +include any_files\images\img_optimize.gif +include any_files\images\img_plate_and_stiffener.gif +include any_files\images\img_stf_button.gif +include any_files\images\img_stiffener.gif +include any_files\images\img_stress_button.gif +include any_files\images\img_T_L_FB.gif +include any_files\images\img_title.gif +include any_files\images\img_transverse_stress.gif +include any_files\images\ANYstructure_logo.jpg +include any_files\images\current_comps_NONE.png +include any_files\images\Buckling_Strength_of_Shells.png +include any_files\images\Panel_geometry_definitions.png +include any_files\ship_section_example.txt +include any_files\ANYstructure_documentation.pdf +include any_files\sections.csv +include any_files\bulb_anglebar_tbar_flatbar.csv +include any_files\ml_files\CL_output_cl_buc_predictor_In-plane_support_cl_1_SP.pickle +include any_files\ml_files\CL_output_cl_buc_scaler_In-plane_support_cl_1_SP.pickle +include any_files\ml_files\CL_output_cl_ult_predictor_In-plane_support_cl_1_SP.pickle +include any_files\ml_files\CL_output_cl_ult_scaler_In-plane_support_cl_1_SP.pickle +include any_files\ml_files\CL_output_cl_buc_predictor_In-plane_support_cl_2,_3_SP.pickle +include any_files\ml_files\CL_output_cl_buc_scaler_In-plane_support_cl_2,_3_SP.pickle +include any_files\ml_files\CL_output_cl_ult_predictor_In-plane_support_cl_2,_3_SP.pickle +include any_files\ml_files\CL_output_cl_ult_scaler_In-plane_support_cl_2,_3_SP.pickle +include any_files\ml_files\CL_output_cl_buc_predictor_In-plane_support_cl_1_UP.pickle +include any_files\ml_files\CL_output_cl_buc_scaler_In-plane_support_cl_1_UP.pickle +include any_files\ml_files\CL_output_cl_ult_predictor_In-plane_support_cl_1_UP.pickle +include any_files\ml_files\CL_output_cl_ult_scaler_In-plane_support_cl_1_UP.pickle +include any_files\ml_files\CL_output_cl_buc_predictor_In-plane_support_cl_2,_3_UP.pickle +include any_files\ml_files\CL_output_cl_buc_scaler_In-plane_support_cl_2,_3_UP.pickle +include any_files\ml_files\CL_output_cl_ult_predictor_In-plane_support_cl_2,_3_UP.pickle +include any_files\ml_files\CL_output_cl_ult_scaler_In-plane_support_cl_2,_3_UP.pickle +include any_files\ml_files\CL_CSR-Tank_req_cl_predictor.pickle +include any_files\ml_files\CL_CSR-Tank_req_cl_UP_scaler.pickle +include any_files\ml_files\CL_CSR_plate_cl,_CSR_web_cl,_CSR_web_flange_cl,_CSR_flange_cl_predictor.pickle +include any_files\ml_files\CL_CSR_plate_cl,_CSR_web_cl,_CSR_web_flange_cl,_CSR_flange_cl_SP_scaler.pickle diff --git a/README.md b/README.md index 01ad61f..c55226d 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,11 @@ ANYstructure is the ultimate steel structure design tool for plate fields and cylinders! Weight optimization for all structures with machine learning capabilities. Calculations are based on DNV standards and rules -### What's new in 4.6 ### +### What's new in 4.7 ### * Corrected error on girder caluculation for cylinder buckling. * Added 1.10 load factor option for cylinder buckling. -* Better compability with linux +* Better compability with linux. +* Python 3.11 based. ### What's new in 4.4 ### * Backup and restore feature added. ### What's new in 4.3 ### diff --git a/__main__.py b/__main__.py index 45dc13a..354a973 100644 --- a/__main__.py +++ b/__main__.py @@ -1,9 +1,6 @@ import sys, multiprocessing, ctypes import tkinter as tk -try: - from main_application import Application -except ModuleNotFoundError: - from ANYstructure.main_application import Application +from any_files.main_application import Application def main(args=None): """The main routine.""" @@ -23,4 +20,4 @@ def main(args=None): # you want your project to do. if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/ANYstructure_documentation.pdf b/any_files/ANYstructure_documentation.pdf similarity index 100% rename from ANYstructure_documentation.pdf rename to any_files/ANYstructure_documentation.pdf diff --git a/SN_curve_parameters.py b/any_files/SN_curve_parameters.py similarity index 100% rename from SN_curve_parameters.py rename to any_files/SN_curve_parameters.py diff --git a/images/__init__.py b/any_files/__init__.py similarity index 100% rename from images/__init__.py rename to any_files/__init__.py diff --git a/any_files/__main__.py b/any_files/__main__.py new file mode 100644 index 0000000..cbb17d7 --- /dev/null +++ b/any_files/__main__.py @@ -0,0 +1,24 @@ +import sys, multiprocessing, ctypes, os +import tkinter as tk +from any_files.main_application import Application + +def main(args=None): + """The main routine.""" + + if args is None: + args = sys.argv[1:] + + multiprocessing.freeze_support() + errorCode = ctypes.windll.shcore.SetProcessDpiAwareness(2) + root = tk.Tk() + width = root.winfo_screenwidth() + height = root.winfo_screenheight() + root.geometry(f'{width}x{height}') + my_app = Application(root) + root.mainloop() + + # Do argument parsing here (eg. with argparse) and anything else + # you want your project to do. + +if __name__ == "__main__": + main() diff --git a/bulb_anglebar_tbar_flatbar.csv b/any_files/bulb_anglebar_tbar_flatbar.csv similarity index 100% rename from bulb_anglebar_tbar_flatbar.csv rename to any_files/bulb_anglebar_tbar_flatbar.csv diff --git a/calc_loads.py b/any_files/calc_loads.py similarity index 100% rename from calc_loads.py rename to any_files/calc_loads.py diff --git a/calc_structure.py b/any_files/calc_structure.py similarity index 99% rename from calc_structure.py rename to any_files/calc_structure.py index 9c3f59d..af251e6 100644 --- a/calc_structure.py +++ b/any_files/calc_structure.py @@ -7,11 +7,11 @@ from scipy.optimize import minimize try: - import helper as hlp - import SN_curve_parameters as snc + import any_files.helper as hlp + import any_files.SN_curve_parameters as snc except ModuleNotFoundError: - import ANYstructure.helper as hlp - import ANYstructure.SN_curve_parameters as snc + import ANYstructure.any_files.helper as hlp + import ANYstructure.any_files.SN_curve_parameters as snc class Structure(): diff --git a/compartment_window.py b/any_files/compartment_window.py similarity index 98% rename from compartment_window.py rename to any_files/compartment_window.py index 1d8d37f..099bfc6 100644 --- a/compartment_window.py +++ b/any_files/compartment_window.py @@ -5,9 +5,9 @@ from matplotlib import pyplot as plt from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg try: - import test + import any_files.test except ModuleNotFoundError: - import ANYstructure.test + import ANYstructure.any_files.test import numpy as np class CreateCompartmentWindow(): diff --git a/example_data.py b/any_files/example_data.py similarity index 99% rename from example_data.py rename to any_files/example_data.py index 341f5e0..47eca3d 100644 --- a/example_data.py +++ b/any_files/example_data.py @@ -1,14 +1,13 @@ # This scripts provide dtat to be used for testing the code - try: - import calc_loads as load - import calc_structure as calc_structure - import make_grid_numpy as grid + import any_files.calc_loads as load + import any_files.calc_structure as calc_structure + import any_files.make_grid_numpy as grid except ModuleNotFoundError: - import ANYstructure.calc_loads as load - import ANYstructure.calc_structure as calc_structure - import ANYstructure.make_grid_numpy as grid + import ANYstructure.any_files.calc_loads as load + import ANYstructure.any_files.calc_structure as calc_structure + import ANYstructure.any_files.make_grid_numpy as grid import random @@ -375,7 +374,7 @@ def get_line_to_struc(geo = False): Stiffener = get_structure_object(line) Girder = None # CalcScantlings(ex.obj_dict_heavy) initial_calc_obj = calc_structure.AllStructure(Plate=Plate, Stiffener=Stiffener, Girder=Girder, - main_dict=prescriptive_main_dict) + main_dict=prescriptive_main_dict) to_return[line]=[initial_calc_obj, None, None, [None], {}] return to_return diff --git a/example_data_puls.py b/any_files/example_data_puls.py similarity index 100% rename from example_data_puls.py rename to any_files/example_data_puls.py diff --git a/excel_inteface.py b/any_files/excel_inteface.py similarity index 100% rename from excel_inteface.py rename to any_files/excel_inteface.py diff --git a/fatigue_window.py b/any_files/fatigue_window.py similarity index 98% rename from fatigue_window.py rename to any_files/fatigue_window.py index 3781542..1ff60d3 100644 --- a/fatigue_window.py +++ b/any_files/fatigue_window.py @@ -2,11 +2,11 @@ import tkinter as tk try: - import example_data as test - import SN_curve_parameters as sn + import any_files.example_data as test + import any_files.SN_curve_parameters as sn except ModuleNotFoundError: - import ANYstructure.example_data as test - import ANYstructure.SN_curve_parameters as sn + import ANYstructure.any_files.example_data as test + import ANYstructure.any_files.SN_curve_parameters as sn class CreateFatigueWindow(): diff --git a/grid_window.py b/any_files/grid_window.py similarity index 99% rename from grid_window.py rename to any_files/grid_window.py index 4161e95..8f40b32 100644 --- a/grid_window.py +++ b/any_files/grid_window.py @@ -6,10 +6,11 @@ import copy import matplotlib.animation as animation + try: - import example_data as test + import any_files.example_data as test except ModuleNotFoundError: - import ANYstructure.example_data as test + import ANYstructure.any_files.example_data as test def dist(p, q): diff --git a/helper.py b/any_files/helper.py similarity index 100% rename from helper.py rename to any_files/helper.py diff --git a/images/ANYstructure screenshot.png b/any_files/images/ANYstructure screenshot.png similarity index 100% rename from images/ANYstructure screenshot.png rename to any_files/images/ANYstructure screenshot.png diff --git a/images/ANYstructure_logo.jpg b/any_files/images/ANYstructure_logo.jpg similarity index 100% rename from images/ANYstructure_logo.jpg rename to any_files/images/ANYstructure_logo.jpg diff --git a/images/Buckling_Strength_of_Shells.png b/any_files/images/Buckling_Strength_of_Shells.png similarity index 100% rename from images/Buckling_Strength_of_Shells.png rename to any_files/images/Buckling_Strength_of_Shells.png diff --git a/images/Cylinder-Load_distribution.png b/any_files/images/Cylinder-Load_distribution.png similarity index 100% rename from images/Cylinder-Load_distribution.png rename to any_files/images/Cylinder-Load_distribution.png diff --git a/images/Definition_of_parameters_L_and_LH.png b/any_files/images/Definition_of_parameters_L_and_LH.png similarity index 100% rename from images/Definition_of_parameters_L_and_LH.png rename to any_files/images/Definition_of_parameters_L_and_LH.png diff --git a/images/Panel_geometry_definitions.png b/any_files/images/Panel_geometry_definitions.png similarity index 100% rename from images/Panel_geometry_definitions.png rename to any_files/images/Panel_geometry_definitions.png diff --git a/any_files/images/__init__.py b/any_files/images/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/images/current_comps_NONE.png b/any_files/images/current_comps_NONE.png similarity index 100% rename from images/current_comps_NONE.png rename to any_files/images/current_comps_NONE.png diff --git a/images/cylinder_opt.png b/any_files/images/cylinder_opt.png similarity index 100% rename from images/cylinder_opt.png rename to any_files/images/cylinder_opt.png diff --git a/images/fls_button.gif b/any_files/images/fls_button.gif similarity index 100% rename from images/fls_button.gif rename to any_files/images/fls_button.gif diff --git a/images/img_T_L_FB.gif b/any_files/images/img_T_L_FB.gif similarity index 100% rename from images/img_T_L_FB.gif rename to any_files/images/img_T_L_FB.gif diff --git a/images/img_axial_stresses.gif b/any_files/images/img_axial_stresses.gif similarity index 100% rename from images/img_axial_stresses.gif rename to any_files/images/img_axial_stresses.gif diff --git a/images/img_dnv_load_combinations.gif b/any_files/images/img_dnv_load_combinations.gif similarity index 100% rename from images/img_dnv_load_combinations.gif rename to any_files/images/img_dnv_load_combinations.gif diff --git a/images/img_ext_pressure_button.gif b/any_files/images/img_ext_pressure_button.gif similarity index 100% rename from images/img_ext_pressure_button.gif rename to any_files/images/img_ext_pressure_button.gif diff --git a/images/img_ext_pressure_button_def.gif b/any_files/images/img_ext_pressure_button_def.gif similarity index 100% rename from images/img_ext_pressure_button_def.gif rename to any_files/images/img_ext_pressure_button_def.gif diff --git a/images/img_fixation_parameters.gif b/any_files/images/img_fixation_parameters.gif similarity index 100% rename from images/img_fixation_parameters.gif rename to any_files/images/img_fixation_parameters.gif diff --git a/images/img_generate_report.gif b/any_files/images/img_generate_report.gif similarity index 100% rename from images/img_generate_report.gif rename to any_files/images/img_generate_report.gif diff --git a/images/img_int_pressure_button.gif b/any_files/images/img_int_pressure_button.gif similarity index 100% rename from images/img_int_pressure_button.gif rename to any_files/images/img_int_pressure_button.gif diff --git a/images/img_int_pressure_button_search.gif b/any_files/images/img_int_pressure_button_search.gif similarity index 100% rename from images/img_int_pressure_button_search.gif rename to any_files/images/img_int_pressure_button_search.gif diff --git a/images/img_multi_opt.gif b/any_files/images/img_multi_opt.gif similarity index 100% rename from images/img_multi_opt.gif rename to any_files/images/img_multi_opt.gif diff --git a/images/img_optimize.gif b/any_files/images/img_optimize.gif similarity index 100% rename from images/img_optimize.gif rename to any_files/images/img_optimize.gif diff --git a/images/img_plate_and_stiffener.gif b/any_files/images/img_plate_and_stiffener.gif similarity index 100% rename from images/img_plate_and_stiffener.gif rename to any_files/images/img_plate_and_stiffener.gif diff --git a/images/img_stf_button.gif b/any_files/images/img_stf_button.gif similarity index 100% rename from images/img_stf_button.gif rename to any_files/images/img_stf_button.gif diff --git a/images/img_stiffened_plate_panel.gif b/any_files/images/img_stiffened_plate_panel.gif similarity index 100% rename from images/img_stiffened_plate_panel.gif rename to any_files/images/img_stiffened_plate_panel.gif diff --git a/images/img_stiffener.gif b/any_files/images/img_stiffener.gif similarity index 100% rename from images/img_stiffener.gif rename to any_files/images/img_stiffener.gif diff --git a/images/img_stress_button.gif b/any_files/images/img_stress_button.gif similarity index 100% rename from images/img_stress_button.gif rename to any_files/images/img_stress_button.gif diff --git a/images/img_title.gif b/any_files/images/img_title.gif similarity index 100% rename from images/img_title.gif rename to any_files/images/img_title.gif diff --git a/images/img_transverse_stress.gif b/any_files/images/img_transverse_stress.gif similarity index 100% rename from images/img_transverse_stress.gif rename to any_files/images/img_transverse_stress.gif diff --git a/load_factor_window.py b/any_files/load_factor_window.py similarity index 100% rename from load_factor_window.py rename to any_files/load_factor_window.py diff --git a/load_window.py b/any_files/load_window.py similarity index 98% rename from load_window.py rename to any_files/load_window.py index d4a0176..dce8fbb 100644 --- a/load_window.py +++ b/any_files/load_window.py @@ -1,12 +1,15 @@ - -try: - import example_data as test - from calc_loads import * - from helper import * -except ModuleNotFoundError: - import ANYstructure.example_data as test - from ANYstructure.calc_loads import * - from ANYstructure.helper import * +import any_files.example_data as test +from any_files.calc_loads import * +from any_files.helper import * + +# try: +# import any_files.example_data as test +# from any_files.calc_loads import * +# from any_files.helper import * +# except ModuleNotFoundError: +# import ANYstructure.any_files.example_data as test +# from ANYstructure.any_files.calc_loads import * +# from ANYstructure.any_files.helper import * import tkinter as tk from tkinter import messagebox diff --git a/main_application.py b/any_files/main_application.py similarity index 99% rename from main_application.py rename to any_files/main_application.py index 4b450ff..de6c3e4 100644 --- a/main_application.py +++ b/any_files/main_application.py @@ -1,14 +1,10 @@ - # -*- coding: utf-8 -*- - -from sklearn.neural_network import MLPClassifier -from sklearn.preprocessing import StandardScaler -from sklearn.metrics._pairwise_distances_reduction import _datasets_pair, _middle_term_computer +import os # -*- coding: utf-8 -*- import tkinter as tk from tkinter import ttk from tkinter import filedialog from tkinter import messagebox -import math, decimal, pickle +import decimal, pickle from _tkinter import TclError import multiprocessing import ctypes @@ -16,44 +12,47 @@ import matplotlib from reportlab.lib.pagesizes import letter, landscape from reportlab.platypus import SimpleDocTemplate +from sklearn.neural_network import MLPClassifier +from sklearn.preprocessing import StandardScaler +from sklearn.metrics._pairwise_distances_reduction import _datasets_pair,_middle_term_computer try: - from calc_structure import * - from calc_loads import * - import load_window as load_window - import make_grid_numpy as grid - import grid_window as grid_window - from helper import * - import optimize as op - import optimize_window as opw - import optimize_cylinder as opc - import optimize_multiple_window as opwmult - import optimize_geometry as optgeo - import pl_stf_window as struc - import stresses_window as stress - import fatigue_window as fatigue - import load_factor_window as load_factors - from report_generator import LetterMaker - import sesam_interface as sesam + from any_files.calc_structure import * + from any_files.calc_loads import * + import any_files.load_window as load_window + import any_files.make_grid_numpy as grid + import any_files.grid_window as grid_window + from any_files.helper import * + import any_files.optimize as op + import any_files.optimize_window as opw + import any_files.optimize_cylinder as opc + import any_files.optimize_multiple_window as opwmult + import any_files.optimize_geometry as optgeo + import any_files.pl_stf_window as struc + import any_files.stresses_window as stress + import any_files.fatigue_window as fatigue + import any_files.load_factor_window as load_factors + from any_files.report_generator import LetterMaker + import any_files.sesam_interface as sesam except ModuleNotFoundError: # This is due to pyinstaller issues. - from ANYstructure.calc_structure import * - from ANYstructure.calc_loads import * - import ANYstructure.load_window as load_window - import ANYstructure.make_grid_numpy as grid - import ANYstructure.grid_window as grid_window - from ANYstructure.helper import * - import ANYstructure.optimize as op - import ANYstructure.optimize_window as opw - import ANYstructure.optimize_cylinder as opc - import ANYstructure.optimize_multiple_window as opwmult - import ANYstructure.optimize_geometry as optgeo - import ANYstructure.pl_stf_window as struc - import ANYstructure.stresses_window as stress - import ANYstructure.fatigue_window as fatigue - import ANYstructure.load_factor_window as load_factors - from ANYstructure.report_generator import LetterMaker - import ANYstructure.sesam_interface as sesam + from ANYstructure.any_files.calc_structure import * + from ANYstructure.any_files.calc_loads import * + import ANYstructure.any_files.load_window as load_window + import ANYstructure.any_files.make_grid_numpy as grid + import ANYstructure.any_files.grid_window as grid_window + from ANYstructure.any_files.helper import * + import ANYstructure.any_files.optimize as op + import ANYstructure.any_files.optimize_window as opw + import ANYstructure.any_files.optimize_cylinder as opc + import ANYstructure.any_files.optimize_multiple_window as opwmult + import ANYstructure.any_files.optimize_geometry as optgeo + import ANYstructure.any_files.pl_stf_window as struc + import ANYstructure.any_files.stresses_window as stress + import ANYstructure.any_files.fatigue_window as fatigue + import ANYstructure.any_files.load_factor_window as load_factors + from ANYstructure.any_files.report_generator import LetterMaker + import ANYstructure.any_files.sesam_interface as sesam @@ -76,6 +75,7 @@ def __init__(self, parent): parent.bind("", self.resize) self._root_dir = os.path.dirname(os.path.abspath(__file__)) + #self._root_dir = os.path.dirname(os.path.abspath(__file__)).replace('any_files','') # Main frame for the application self._main_fr = ttk.Frame(parent) self._main_fr.place(in_=parent, relwidth=1, relheight = 0.99) @@ -361,7 +361,9 @@ def __init__(self, parent): file.close() else: #file = open(self._root_dir +'\\' + file_base + '.pickle', 'rb') - file = open(os.path.join(self._root_dir, file_base + '.pickle'), 'rb') + + ml_file = os.path.join(self._root_dir, file_base + '.pickle') + file = open(ml_file, 'rb') self._ML_buckling[name] = pickle.load(file) file.close() @@ -2726,8 +2728,8 @@ def grid_find_tanks(self, animate = False): self.grid_operations(line, [self.get_grid_coord_from_points_coords(p1), self.get_grid_coord_from_points_coords(p2)]) - self._grid_calc = grid_window.CreateGridWindow(self._main_grid,self._canvas_dim, - self._pending_grid_draw,self._canvas_base_origo) + self._grid_calc = grid_window.CreateGridWindow(self._main_grid, self._canvas_dim, + self._pending_grid_draw, self._canvas_base_origo) compartment_search_return = self._grid_calc.search_bfs(animate=animate) @@ -4734,14 +4736,14 @@ def report_generate(self, autosave = False): if save_file is None: # ask saveasfile return `None` if dialog closed with "cancel". return else: - filename = 'testrun.pdf' + filename = '../testrun.pdf' if self._line_dict == {}: tk.messagebox.showerror('No lines', 'No lines defined. Cannot make report.') return - if os.path.isfile('current_comps.png'): - os.remove('current_comps.png') + if os.path.isfile('../current_comps.png'): + os.remove('../current_comps.png') self.grid_display_tanks(save = True) else: self.grid_display_tanks(save=True) @@ -4766,7 +4768,7 @@ def table_generate(self, autosave = False): if save_file is None: # ask saveasfile return `None` if dialog closed with "cancel". return else: - filename = 'testrun.pdf' + filename = '../testrun.pdf' if self._line_dict == {}: tk.messagebox.showerror('No lines', 'No lines defined. Cannot make report.') @@ -6420,7 +6422,7 @@ def draw_point_frame(self): def save_no_dialogue(self, event = None, backup = False): if backup: - self.savefile(filename=os.path.join(self._root_dir,'backup.txt'),backup = backup) + self.savefile(filename=os.path.join(self._root_dir, '../backup.txt'), backup = backup) return if self.__last_save_file is not None: self.savefile(filename=self.__last_save_file) @@ -6747,8 +6749,12 @@ def openfile(self, defined = None, alone = False): # Setting the scale of the canvas points = self._point_dict - highest_y = max([coord[1] for coord in points.values()]) - highest_x = max([coord[0] for coord in points.values()]) + if len(points) != 0: + highest_y = max([coord[1] for coord in points.values()]) + highest_x = max([coord[0] for coord in points.values()]) + else: + highest_x = 1 + highest_y = 1 if not any([highest_x == 0, highest_y == 0]): self._canvas_scale = min(800 / highest_y, 800 / highest_x, 15) @@ -6765,8 +6771,8 @@ def openfile(self, defined = None, alone = False): self.update_frame() def restore_previous(self): - if os.path.isfile(os.path.join(self._root_dir,'backup.txt')): - self.openfile(defined=os.path.join(self._root_dir, 'backup.txt')) + if os.path.isfile(os.path.join(self._root_dir, '../backup.txt')): + self.openfile(defined=os.path.join(self._root_dir, '../backup.txt')) def open_example(self, file_name = 'ship_section_example.txt'): diff --git a/make_grid_numpy.py b/any_files/make_grid_numpy.py similarity index 100% rename from make_grid_numpy.py rename to any_files/make_grid_numpy.py diff --git a/make_queue.py b/any_files/make_queue.py similarity index 100% rename from make_queue.py rename to any_files/make_queue.py diff --git a/make_stack.py b/any_files/make_stack.py similarity index 100% rename from make_stack.py rename to any_files/make_stack.py diff --git a/ml_files/CL_CSR-Tank_req_cl_UP_scaler.pickle b/any_files/ml_files/CL_CSR-Tank_req_cl_UP_scaler.pickle similarity index 100% rename from ml_files/CL_CSR-Tank_req_cl_UP_scaler.pickle rename to any_files/ml_files/CL_CSR-Tank_req_cl_UP_scaler.pickle diff --git a/ml_files/CL_CSR-Tank_req_cl_predictor.pickle b/any_files/ml_files/CL_CSR-Tank_req_cl_predictor.pickle similarity index 100% rename from ml_files/CL_CSR-Tank_req_cl_predictor.pickle rename to any_files/ml_files/CL_CSR-Tank_req_cl_predictor.pickle diff --git a/ml_files/CL_CSR_plate_cl,_CSR_web_cl,_CSR_web_flange_cl,_CSR_flange_cl_SP_scaler.pickle b/any_files/ml_files/CL_CSR_plate_cl,_CSR_web_cl,_CSR_web_flange_cl,_CSR_flange_cl_SP_scaler.pickle similarity index 100% rename from ml_files/CL_CSR_plate_cl,_CSR_web_cl,_CSR_web_flange_cl,_CSR_flange_cl_SP_scaler.pickle rename to any_files/ml_files/CL_CSR_plate_cl,_CSR_web_cl,_CSR_web_flange_cl,_CSR_flange_cl_SP_scaler.pickle diff --git a/ml_files/CL_CSR_plate_cl,_CSR_web_cl,_CSR_web_flange_cl,_CSR_flange_cl_predictor.pickle b/any_files/ml_files/CL_CSR_plate_cl,_CSR_web_cl,_CSR_web_flange_cl,_CSR_flange_cl_predictor.pickle similarity index 100% rename from ml_files/CL_CSR_plate_cl,_CSR_web_cl,_CSR_web_flange_cl,_CSR_flange_cl_predictor.pickle rename to any_files/ml_files/CL_CSR_plate_cl,_CSR_web_cl,_CSR_web_flange_cl,_CSR_flange_cl_predictor.pickle diff --git a/ml_files/CL_output_cl_buc_predictor_In-plane_support_cl_1_SP.pickle b/any_files/ml_files/CL_output_cl_buc_predictor_In-plane_support_cl_1_SP.pickle similarity index 100% rename from ml_files/CL_output_cl_buc_predictor_In-plane_support_cl_1_SP.pickle rename to any_files/ml_files/CL_output_cl_buc_predictor_In-plane_support_cl_1_SP.pickle diff --git a/ml_files/CL_output_cl_buc_predictor_In-plane_support_cl_1_UP.pickle b/any_files/ml_files/CL_output_cl_buc_predictor_In-plane_support_cl_1_UP.pickle similarity index 100% rename from ml_files/CL_output_cl_buc_predictor_In-plane_support_cl_1_UP.pickle rename to any_files/ml_files/CL_output_cl_buc_predictor_In-plane_support_cl_1_UP.pickle diff --git a/ml_files/CL_output_cl_buc_predictor_In-plane_support_cl_2,_3_SP.pickle b/any_files/ml_files/CL_output_cl_buc_predictor_In-plane_support_cl_2,_3_SP.pickle similarity index 100% rename from ml_files/CL_output_cl_buc_predictor_In-plane_support_cl_2,_3_SP.pickle rename to any_files/ml_files/CL_output_cl_buc_predictor_In-plane_support_cl_2,_3_SP.pickle diff --git a/ml_files/CL_output_cl_buc_predictor_In-plane_support_cl_2,_3_UP.pickle b/any_files/ml_files/CL_output_cl_buc_predictor_In-plane_support_cl_2,_3_UP.pickle similarity index 100% rename from ml_files/CL_output_cl_buc_predictor_In-plane_support_cl_2,_3_UP.pickle rename to any_files/ml_files/CL_output_cl_buc_predictor_In-plane_support_cl_2,_3_UP.pickle diff --git a/ml_files/CL_output_cl_buc_scaler_In-plane_support_cl_1_SP.pickle b/any_files/ml_files/CL_output_cl_buc_scaler_In-plane_support_cl_1_SP.pickle similarity index 100% rename from ml_files/CL_output_cl_buc_scaler_In-plane_support_cl_1_SP.pickle rename to any_files/ml_files/CL_output_cl_buc_scaler_In-plane_support_cl_1_SP.pickle diff --git a/ml_files/CL_output_cl_buc_scaler_In-plane_support_cl_1_UP.pickle b/any_files/ml_files/CL_output_cl_buc_scaler_In-plane_support_cl_1_UP.pickle similarity index 100% rename from ml_files/CL_output_cl_buc_scaler_In-plane_support_cl_1_UP.pickle rename to any_files/ml_files/CL_output_cl_buc_scaler_In-plane_support_cl_1_UP.pickle diff --git a/ml_files/CL_output_cl_buc_scaler_In-plane_support_cl_2,_3_SP.pickle b/any_files/ml_files/CL_output_cl_buc_scaler_In-plane_support_cl_2,_3_SP.pickle similarity index 100% rename from ml_files/CL_output_cl_buc_scaler_In-plane_support_cl_2,_3_SP.pickle rename to any_files/ml_files/CL_output_cl_buc_scaler_In-plane_support_cl_2,_3_SP.pickle diff --git a/ml_files/CL_output_cl_buc_scaler_In-plane_support_cl_2,_3_UP.pickle b/any_files/ml_files/CL_output_cl_buc_scaler_In-plane_support_cl_2,_3_UP.pickle similarity index 100% rename from ml_files/CL_output_cl_buc_scaler_In-plane_support_cl_2,_3_UP.pickle rename to any_files/ml_files/CL_output_cl_buc_scaler_In-plane_support_cl_2,_3_UP.pickle diff --git a/ml_files/CL_output_cl_ult_predictor_In-plane_support_cl_1_SP.pickle b/any_files/ml_files/CL_output_cl_ult_predictor_In-plane_support_cl_1_SP.pickle similarity index 100% rename from ml_files/CL_output_cl_ult_predictor_In-plane_support_cl_1_SP.pickle rename to any_files/ml_files/CL_output_cl_ult_predictor_In-plane_support_cl_1_SP.pickle diff --git a/ml_files/CL_output_cl_ult_predictor_In-plane_support_cl_1_UP.pickle b/any_files/ml_files/CL_output_cl_ult_predictor_In-plane_support_cl_1_UP.pickle similarity index 100% rename from ml_files/CL_output_cl_ult_predictor_In-plane_support_cl_1_UP.pickle rename to any_files/ml_files/CL_output_cl_ult_predictor_In-plane_support_cl_1_UP.pickle diff --git a/ml_files/CL_output_cl_ult_predictor_In-plane_support_cl_2,_3_SP.pickle b/any_files/ml_files/CL_output_cl_ult_predictor_In-plane_support_cl_2,_3_SP.pickle similarity index 100% rename from ml_files/CL_output_cl_ult_predictor_In-plane_support_cl_2,_3_SP.pickle rename to any_files/ml_files/CL_output_cl_ult_predictor_In-plane_support_cl_2,_3_SP.pickle diff --git a/ml_files/CL_output_cl_ult_predictor_In-plane_support_cl_2,_3_UP.pickle b/any_files/ml_files/CL_output_cl_ult_predictor_In-plane_support_cl_2,_3_UP.pickle similarity index 100% rename from ml_files/CL_output_cl_ult_predictor_In-plane_support_cl_2,_3_UP.pickle rename to any_files/ml_files/CL_output_cl_ult_predictor_In-plane_support_cl_2,_3_UP.pickle diff --git a/ml_files/CL_output_cl_ult_scaler_In-plane_support_cl_1_SP.pickle b/any_files/ml_files/CL_output_cl_ult_scaler_In-plane_support_cl_1_SP.pickle similarity index 100% rename from ml_files/CL_output_cl_ult_scaler_In-plane_support_cl_1_SP.pickle rename to any_files/ml_files/CL_output_cl_ult_scaler_In-plane_support_cl_1_SP.pickle diff --git a/ml_files/CL_output_cl_ult_scaler_In-plane_support_cl_1_UP.pickle b/any_files/ml_files/CL_output_cl_ult_scaler_In-plane_support_cl_1_UP.pickle similarity index 100% rename from ml_files/CL_output_cl_ult_scaler_In-plane_support_cl_1_UP.pickle rename to any_files/ml_files/CL_output_cl_ult_scaler_In-plane_support_cl_1_UP.pickle diff --git a/ml_files/CL_output_cl_ult_scaler_In-plane_support_cl_2,_3_SP.pickle b/any_files/ml_files/CL_output_cl_ult_scaler_In-plane_support_cl_2,_3_SP.pickle similarity index 100% rename from ml_files/CL_output_cl_ult_scaler_In-plane_support_cl_2,_3_SP.pickle rename to any_files/ml_files/CL_output_cl_ult_scaler_In-plane_support_cl_2,_3_SP.pickle diff --git a/ml_files/CL_output_cl_ult_scaler_In-plane_support_cl_2,_3_UP.pickle b/any_files/ml_files/CL_output_cl_ult_scaler_In-plane_support_cl_2,_3_UP.pickle similarity index 100% rename from ml_files/CL_output_cl_ult_scaler_In-plane_support_cl_2,_3_UP.pickle rename to any_files/ml_files/CL_output_cl_ult_scaler_In-plane_support_cl_2,_3_UP.pickle diff --git a/opt_problem.py b/any_files/opt_problem.py similarity index 100% rename from opt_problem.py rename to any_files/opt_problem.py diff --git a/optimize.py b/any_files/optimize.py similarity index 99% rename from optimize.py rename to any_files/optimize.py index ce347be..b8ca126 100644 --- a/optimize.py +++ b/any_files/optimize.py @@ -13,11 +13,11 @@ import csv try: - import calc_structure as calc - import helper as hlp + import any_files.calc_structure as calc + import any_files.helper as hlp except ModuleNotFoundError: - import ANYstructure.calc_structure as calc - import ANYstructure.helper as hlp + import ANYstructure.any_files.calc_structure as calc + import ANYstructure.any_files.helper as hlp def run_optmizataion(initial_structure_obj=None, min_var=None, max_var=None, lateral_pressure=None, diff --git a/optimize_cylinder.py b/any_files/optimize_cylinder.py similarity index 97% rename from optimize_cylinder.py rename to any_files/optimize_cylinder.py index 2543849..4901d3f 100644 --- a/optimize_cylinder.py +++ b/any_files/optimize_cylinder.py @@ -8,13 +8,13 @@ from multiprocessing import cpu_count try: - import main_application - import optimize as op - import example_data as test + import any_files.main_application + import any_files.optimize as op + import any_files.example_data as test except ModuleNotFoundError: - import ANYstructure.main_application - import ANYstructure.optimize as op - import ANYstructure.example_data as test + import ANYstructure.any_files.main_application + import ANYstructure.any_files.optimize as op + import ANYstructure.any_files.example_data as test class CreateOptimizeCylinderWindow(): ''' @@ -73,8 +73,6 @@ def __init__(self,master,app=None): self._ML_buckling[name] = None if os.path.isfile(file_base + '.pickle'): file = open(file_base + '.pickle', 'rb') - from sklearn.neural_network import MLPClassifier - from sklearn.preprocessing import StandardScaler self._ML_buckling[name] = pickle.load(file) file.close() @@ -496,10 +494,10 @@ def __init__(self,master,app=None): self.update_running_time() main_application.Application.draw_cylinder(text_size='Verdana 8 bold', - canvas = self._canvas_opt, - CylObj=self._initial_cylinder_obj, - start_x_cyl=350, start_y_cyl=300, text_x=230, - text_y=120) + canvas = self._canvas_opt, + CylObj=self._initial_cylinder_obj, + start_x_cyl=350, start_y_cyl=300, text_x=230, + text_y=120) def selected_algorithm(self,event): ''' @@ -630,10 +628,10 @@ def run_optimizaion(self): self._canvas_opt.delete('all') main_application.Application.draw_cylinder(text_size='Verdana 8 bold', - canvas = self._canvas_opt, - CylObj=self._opt_results[0], - start_x_cyl=350, start_y_cyl=300, text_x=230, - text_y=120) + canvas = self._canvas_opt, + CylObj=self._opt_results[0], + start_x_cyl=350, start_y_cyl=300, text_x=230, + text_y=120) self._new_sasd.set(self._opt_results[0].sasd) self._new_smsd.set(self._opt_results[0].smsd) self._new_tTsd.set(self._opt_results[0].tTsd) diff --git a/optimize_geometry.py b/any_files/optimize_geometry.py similarity index 99% rename from optimize_geometry.py rename to any_files/optimize_geometry.py index 706f25e..cce57c2 100644 --- a/optimize_geometry.py +++ b/any_files/optimize_geometry.py @@ -3,26 +3,26 @@ from _tkinter import TclError from tkinter.ttk import Progressbar from tkinter import messagebox -import copy, pickle +import pickle from tkinter.filedialog import askopenfilenames from multiprocessing import cpu_count from tkinter import filedialog from matplotlib import pyplot as plt try: - import main_application - import optimize as op - import example_data as test - from calc_structure import * - import calc_structure - from helper import * + import any_files.main_application + import any_files.optimize as op + import any_files.example_data as test + from any_files.calc_structure import * + import any_files.calc_structure + from any_files.helper import * except ModuleNotFoundError: - import ANYstructure.main_application - import ANYstructure.optimize as op - import ANYstructure.example_data as test - from ANYstructure.calc_structure import * - import ANYstructure.calc_structure - from ANYstructure.helper import * + import ANYstructure.any_files.main_application + import ANYstructure.any_files.optimize as op + import ANYstructure.any_files.example_data as test + from ANYstructure.any_files.calc_structure import * + import ANYstructure.any_files.calc_structure + from ANYstructure.any_files.helper import * class CreateOptGeoWindow(): @@ -79,8 +79,6 @@ def __init__(self, master, app=None): self._ML_buckling[name] = None if os.path.isfile(file_base + '.pickle'): file = open(file_base + '.pickle', 'rb') - from sklearn.neural_network import MLPClassifier - from sklearn.preprocessing import StandardScaler self._ML_buckling[name] = pickle.load(file) file.close() else: diff --git a/optimize_multiple_window.py b/any_files/optimize_multiple_window.py similarity index 99% rename from optimize_multiple_window.py rename to any_files/optimize_multiple_window.py index 3ab99b6..27c865f 100644 --- a/optimize_multiple_window.py +++ b/any_files/optimize_multiple_window.py @@ -7,21 +7,21 @@ from multiprocessing import Pool, cpu_count try: - import main_application - import optimize as op - import example_data as test - from calc_structure import * - import calc_structure as calc - from helper import * - import optimize as opt + import any_files.main_application + import any_files.optimize as op + import any_files.example_data as test + from any_files.calc_structure import * + import any_files.calc_structure as calc + from any_files.helper import * + import any_files.optimize as opt except ModuleNotFoundError: - import ANYstructure.main_application - import ANYstructure.optimize as op - import ANYstructure.example_data as test - from ANYstructure.calc_structure import * - import ANYstructure.calc_structure as calc - from ANYstructure.helper import * - import ANYstructure.optimize as opt + import ANYstructure.any_files.main_application + import ANYstructure.any_files.optimize as op + import ANYstructure.any_files.example_data as test + from ANYstructure.any_files.calc_structure import * + import ANYstructure.any_files.calc_structure as calc + from ANYstructure.any_files.helper import * + import ANYstructure.any_files.optimize as opt def helper_harmonizer_multi(iterator): diff --git a/optimize_window.py b/any_files/optimize_window.py similarity index 99% rename from optimize_window.py rename to any_files/optimize_window.py index 2e86bc3..a2a31a8 100644 --- a/optimize_window.py +++ b/any_files/optimize_window.py @@ -8,17 +8,17 @@ from multiprocessing import cpu_count try: - from calc_structure import CalcScantlings, AllStructure - import example_data as test - import example_data as ex - import helper as hlp - import optimize as op + from any_files.calc_structure import CalcScantlings, AllStructure + import any_files.example_data as test + import any_files.example_data as ex + import any_files.helper as hlp + import any_files.optimize as op except ModuleNotFoundError: - from ANYstructure.calc_structure import CalcScantlings, AllStructure - import ANYstructure.example_data as test - import ANYstructure.example_data as ex - import ANYstructure.helper as hlp - import ANYstructure.optimize as op + from ANYstructure.any_files.calc_structure import CalcScantlings, AllStructure + import ANYstructure.any_files.example_data as test + import ANYstructure.any_files.example_data as ex + import ANYstructure.any_files.helper as hlp + import ANYstructure.any_files.optimize as op class CreateOptimizeWindow(): ''' This class initiates the single optimization window. @@ -44,7 +44,7 @@ def __init__(self,master,app=None): self._puls_acceptance = 0.87 self._initial_calc_obj.lat_press = self._lateral_pressure/1000 self._ML_buckling = dict() # Buckling machine learning algorithm - self._root_dir = 'C:\\Github\\ANYstructure\\' + self._root_dir = '/\\' for name, file_base in zip(['cl SP buc int predictor', 'cl SP buc int scaler', 'cl SP ult int predictor', 'cl SP ult int scaler', 'cl SP buc GLGT predictor', 'cl SP buc GLGT scaler', diff --git a/pl_stf_window.py b/any_files/pl_stf_window.py similarity index 99% rename from pl_stf_window.py rename to any_files/pl_stf_window.py index d436ba7..d6e64f7 100644 --- a/pl_stf_window.py +++ b/any_files/pl_stf_window.py @@ -5,11 +5,11 @@ import os try: - import example_data as test - import helper as hlp + import any_files.example_data as test + import any_files.helper as hlp except ModuleNotFoundError: - import ANYstructure.example_data as test - import ANYstructure.helper as hlp + import ANYstructure.any_files.example_data as test + import ANYstructure.any_files.helper as hlp from matplotlib.backends.backend_tkagg import ( diff --git a/report_generator.py b/any_files/report_generator.py similarity index 99% rename from report_generator.py rename to any_files/report_generator.py index bb974b7..91632b9 100644 --- a/report_generator.py +++ b/any_files/report_generator.py @@ -21,11 +21,11 @@ import tkinter as tk try: - import example_data as test - import helper as hlp + import any_files.example_data as test + import any_files.helper as hlp except ModuleNotFoundError: - import ANYstructure.example_data as test - import ANYstructure.helper as hlp + import ANYstructure.any_files.example_data as test + import ANYstructure.any_files.helper as hlp diff --git a/sections.csv b/any_files/sections.csv similarity index 100% rename from sections.csv rename to any_files/sections.csv diff --git a/sesam_interface.py b/any_files/sesam_interface.py similarity index 95% rename from sesam_interface.py rename to any_files/sesam_interface.py index e93e42b..14cf419 100644 --- a/sesam_interface.py +++ b/any_files/sesam_interface.py @@ -5,11 +5,11 @@ try: - import pl_stf_window as plstf - import helper as hlp + import any_files.pl_stf_window as plstf + import any_files.helper as hlp except ModuleNotFoundError: - import ANYstructure.pl_stf_window as plstf - import ANYstructure.helper as hlp + import ANYstructure.any_files.pl_stf_window as plstf + import ANYstructure.any_files.helper as hlp def point_to_js_command(point_coord, point_name): ''' Returning a js script. diff --git a/ship_section_example.txt b/any_files/ship_section_example.txt similarity index 100% rename from ship_section_example.txt rename to any_files/ship_section_example.txt diff --git a/stresses_window.py b/any_files/stresses_window.py similarity index 99% rename from stresses_window.py rename to any_files/stresses_window.py index deefdda..05aee5d 100644 --- a/stresses_window.py +++ b/any_files/stresses_window.py @@ -4,9 +4,9 @@ from _tkinter import TclError import os try: - import example_data as test + import any_files.example_data as test except ModuleNotFoundError: - import ANYstructure.example_data as test + import ANYstructure.any_files.example_data as test class CreateStressesWindow(): diff --git a/testCalc.py b/any_files/testCalc.py similarity index 98% rename from testCalc.py rename to any_files/testCalc.py index 6dcc9be..6ac2d55 100644 --- a/testCalc.py +++ b/any_files/testCalc.py @@ -1,9 +1,9 @@ import pprint from calc_structure import * try: - from calc_structure import * + from any_files.calc_structure import * except ModuleNotFoundError: - from ANYstructure.calc_structure import * + from ANYstructure.any_files.calc_structure import * structure_types = {'vertical': ['BBS', 'SIDE_SHELL', 'SSS'], 'horizontal': ['BOTTOM', 'BBT', 'HOPPER', 'MD'], diff --git a/setup.py b/setup.py index 705d31a..8c99b32 100644 --- a/setup.py +++ b/setup.py @@ -26,10 +26,10 @@ def readme(): setup( name='ANYstructure', # Required url = 'https://github.com/audunarn/ANYstructure', - entry_points={"console_scripts": ['ANYstructure = __main__:main']}, - version=4.6, # Required + entry_points={"console_scripts": ['ANYstructure = any_files.__main__:main']}, + version='4.7', # Required license='MIT', - description='A plate field optimization tool for offshore structures calculated according to DNVGL standards', + description='A plate field optimization tool for offshore structures calculated according to DNV standards', long_description = readme(), author='Audun Arnesen Nyhus', # Optional author_email='audunarn@gmail.com', # Optional @@ -41,6 +41,7 @@ def readme(): 'Topic :: Scientific/Engineering'], keywords='dnvgl-gl-os-c101 naval_architecture structural_engineering steel buckling fatigue local_scantlings optimization weight', include_package_data=True, - - install_requires=['scipy', 'numpy', 'matplotlib', 'reportlab', 'xlwings', 'sklearn', 'scikit-learn'] + install_requires=['scipy', 'numpy', 'matplotlib', 'reportlab', 'xlwings', 'sklearn', 'scikit-learn'], + packages=['any_files'], + py_modules = [], ) \ No newline at end of file diff --git a/tests/gui_automatic_run.py b/tests/gui_automatic_run.py index e91f0e6..54d8460 100644 --- a/tests/gui_automatic_run.py +++ b/tests/gui_automatic_run.py @@ -1,4 +1,4 @@ -import main_application +from any_files import main_application import multiprocessing, ctypes, os, pickle import tkinter as tk @@ -72,8 +72,6 @@ def run_cc_chks(): if os.path.isfile('C:\\Github\\ANYstructure\\'+file_base + '.pickle'): file = open('C:\\Github\\ANYstructure\\'+file_base + '.pickle', 'rb') - from sklearn.neural_network import MLPClassifier - from sklearn.preprocessing import StandardScaler my_dict['_ML_buckling'] [name] = pickle.load(file) file.close() diff --git a/tests/test_calc_loads_loads.py b/tests/test_calc_loads_loads.py index c191bca..626c310 100644 --- a/tests/test_calc_loads_loads.py +++ b/tests/test_calc_loads_loads.py @@ -1,6 +1,6 @@ -import calc_loads as calcl +from any_files import calc_loads as calcl, example_data as ex import pytest -import example_data as ex + # Testing the Structure class diff --git a/tests/test_calc_loads_tank.py b/tests/test_calc_loads_tank.py index a6e419b..7c2a835 100644 --- a/tests/test_calc_loads_tank.py +++ b/tests/test_calc_loads_tank.py @@ -1,6 +1,6 @@ -import calc_loads as calcl +from any_files import calc_loads as calcl, example_data as ex import pytest -import example_data as ex + # Testing the Structure class diff --git a/tests/test_calc_structure_scantlings.py b/tests/test_calc_structure_scantlings.py index 62e468b..ff4d0a0 100644 --- a/tests/test_calc_structure_scantlings.py +++ b/tests/test_calc_structure_scantlings.py @@ -1,6 +1,6 @@ -import calc_structure as calc import pytest -import example_data as ex +from any_files import example_data as ex, calc_structure as calc + # Testing the Structure class diff --git a/tests/test_calc_structure_structure.py b/tests/test_calc_structure_structure.py index 8683172..dbb6e26 100644 --- a/tests/test_calc_structure_structure.py +++ b/tests/test_calc_structure_structure.py @@ -1,6 +1,6 @@ -import calc_structure as calc import pytest -import example_data as ex +from any_files import example_data as ex, calc_structure as calc + # Testing the Structure class diff --git a/tests/test_calc_strucure_fatigue.py b/tests/test_calc_strucure_fatigue.py index cbb3173..49b2972 100644 --- a/tests/test_calc_strucure_fatigue.py +++ b/tests/test_calc_strucure_fatigue.py @@ -1,6 +1,6 @@ -import calc_structure as calc import pytest -import example_data as ex +from any_files import example_data as ex, calc_structure as calc + # Testing the Structure class diff --git a/tests/test_grid_operations.py b/tests/test_grid_operations.py index 798d5a7..7a44396 100644 --- a/tests/test_grid_operations.py +++ b/tests/test_grid_operations.py @@ -1,6 +1,6 @@ -import grid_window as grid_operations import pytest -import make_grid_numpy as grid_np +from any_files import make_grid_numpy as grid_np, grid_window as grid_operations + # Testing the Structure class diff --git a/tests/test_make_grid.py b/tests/test_make_grid.py index 9712265..3152b84 100644 --- a/tests/test_make_grid.py +++ b/tests/test_make_grid.py @@ -1,4 +1,4 @@ -import make_grid_numpy as grid +from any_files import make_grid_numpy as grid import pytest import numpy as np diff --git a/tests/test_optimize.py b/tests/test_optimize.py index 2c3c9d5..ede86ca 100644 --- a/tests/test_optimize.py +++ b/tests/test_optimize.py @@ -1,6 +1,4 @@ -import optimize as opt -import example_data as ex -import calc_structure as calc +from any_files import optimize as opt, example_data as ex, calc_structure as calc import numpy as np import pytest