Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove legacy code #487

Open
PythonFZ opened this issue Jan 31, 2022 · 4 comments
Open

Remove legacy code #487

PythonFZ opened this issue Jan 31, 2022 · 4 comments

Comments

@PythonFZ
Copy link
Member

I actually think several meta functions are now legacy and can be removed. I will leave this for a future PR.

Originally posted by @SamTov in #475 (comment)

@PythonFZ
Copy link
Member Author

Using https://github.com/jendrikseipp/vulture I found (sorry for the long path):

C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\calculators\angular_distribution_function.py:212: unused attribute '_batch_size' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\calculators\calculator.py:46: unused attribute 'monitor_interval' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\calculators\coordination_number_calculation.py:111: unused attribute 'file_to_study' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\calculators\coordination_number_calculation.py:121: unused attribute 'post_generation' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\calculators\einstein_distinct_diffusion_coefficients.py:57: unused attribute 'monitor_interval' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\calculators\einstein_distinct_diffusion_coefficients.py:120: unused variable 'save' (100% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\calculators\green_kubo_distinct_diffusion_coefficients.py:115: unused variable 'save' (100% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\calculators\green_kubo_self_diffusion_coefficients.py:275: unused attribute 'extra_y_ranges' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\calculators\kirkwood_buff_integrals.py:97: unused attribute 'file_to_study' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\calculators\kirkwood_buff_integrals.py:98: unused attribute 'data_files' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\calculators\kirkwood_buff_integrals.py:109: unused attribute 'post_generation' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\calculators\nernst_einstein_ionic_conductivity.py:60: unused attribute 'post_generation' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\calculators\nernst_einstein_ionic_conductivity.py:76: unused variable 'save' (100% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\calculators\nernst_einstein_ionic_conductivity.py:403: unused method 'run_post_generation_analysis' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\calculators\potential_of_mean_force.py:111: unused attribute 'file_to_study' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\calculators\potential_of_mean_force.py:124: unused attribute 'post_generation' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\calculators\potential_of_mean_force.py:152: unused attribute 'data_files' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\calculators\radial_distribution_function.py:145: unused variable 'save' (100% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\calculators\spatial_distribution_function.py:74: unused class 'SpatialDistributionFunction' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\calculators\structure_factor.py:113: unused attribute 'file_to_study' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\calculators\structure_factor.py:114: unused attribute 'data_files' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\calculators\structure_factor.py:119: unused attribute 'post_generation' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\database\calculator_database.py:247: unused method 'update_database' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\database\calculator_database.py:247: unused variable 'delete_duplicate' (100% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\database\calculator_database.py:247: unused variable 'parameters' (100% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\database\database_base.py:58: unused attribute '_Session' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\database\experiment_database.py:87: unused variable 'property_groups' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\database\experiment_database.py:97: unused variable 'parameters' (100% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\database\scheme.py:47: unused variable 'computation_results_id' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\database\scheme.py:50: unused variable 'experiment_species_id' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\database\scheme.py:89: unused variable 'experiment_attributes' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\database\scheme.py:328: unused variable 'computation_id' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\database\scheme.py:347: unused variable 'computation_id' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\database\simulation_database.py:136: unused variable 'sample_step' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\database\simulation_database.py:233: unused method '_update_indices' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\database\simulation_database.py:466: unused method '_add_group_structure' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\database\simulation_database.py:538: unused method 'change_key_names' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\database\simulation_database.py:595: unused method 'get_load_time' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\database\simulation_database.py:646: unused method 'get_database_summary' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\database\types.py:37: unused variable 'impl' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\database\types.py:39: unused method 'process_bind_param' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\database\types.py:39: unused variable 'dialect' (100% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\database\types.py:48: unused method 'process_result_value' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\database\types.py:48: unused variable 'dialect' (100% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\experiment\experiment.py:202: unused attribute 'property_groups' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\experiment\experiment.py:214: unused attribute 'analyse_time_series' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\experiment\experiment.py:430: unused method 'set_charge' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\experiment\experiment.py:446: unused method 'set_mass' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\experiment\experiment.py:553: unused attribute 'memory_requirements' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\experiment\experiment.py:558: unused method 'load_matrix' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\experiment\experiment.py:642: unused attribute 'property_groups' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\file_io\chemfiles_read.py:15: unused class 'ChemfilesRead' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\file_io\script_input.py:7: unused class 'ScriptInput' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\graph_modules\adjacency_matrix.py:29: unused class 'AdjacencyMatrix' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\graph_modules\molecular_graph.py:81: unused method '_perform_checks' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\graph_modules\molecular_graph.py:159: unused variable 'adjacency' (100% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\memory_management\memory_manager.py:226: unused method 'hdf5_load_time' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\memory_management\memory_manager.py:287: unused variable 'total_rows' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\memory_management\memory_manager.py:292: unused variable 'total_rows' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\project\project.py:154: unused method 'add_experiment' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\project\project.py:260: unused method 'disable_experiments' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\transformations\map_molecules.py:122: unused method '_update_type_dict' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\transformations\map_molecules.py:146: unused method '_update_species_type_dict' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\utils\calculator_helper_methods.py:86: unused variable 'pcov' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\utils\config.py:42: unused variable 'GPU' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\utils\exceptions.py:29: unused class 'NoElementInDump' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\utils\exceptions.py:37: unused class 'NoTempInData' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\utils\exceptions.py:45: unused class 'NotApplicableToAnalysis' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\utils\exceptions.py:77: unused class 'DatasetExists' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\utils\exceptions.py:85: unused class 'RangeExceeded' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\utils\exceptions.py:94: unused class 'DatabaseDoesNotExist' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\utils\exceptions.py:105: unused class 'NotInDataFile' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\utils\meta_functions.py:162: unused function 'line_counter' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\utils\meta_functions.py:243: unused function 'linear_fitting_function' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\utils\meta_functions.py:268: unused function 'simple_file_read' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\utils\meta_functions.py:297: unused function 'timeit' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\utils\meta_functions.py:447: unused function 'round_down' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\utils\testing.py:89: unused property 'exception' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\utils\units.py:29: unused variable 'standard_state_pressure' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\utils\units.py:30: unused variable 'avogadro_constant' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\utils\units.py:33: unused variable 'hyperfine_transition_frequency' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\utils\units.py:36: unused variable 'luminous_efficacy' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\utils\units.py:37: unused variable 'planck_constant' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\utils\units.py:38: unused variable 'reduced_planck_constant' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\utils\units.py:39: unused variable 'speed_of_light' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\utils\units.py:40: unused variable 'gravity' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\utils\units.py:41: unused variable 'atmosphere' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\utils\units.py:54: unused variable 'NkTV2p' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\utils\units.py:55: unused variable 'boltzmann' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\utils\units.py:57: unused variable 'pressure' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\utils\units.py:58: unused variable 'avogadro' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\visualizer\d3_data_visualizer.py:70: unused attribute 'points' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\visualizer\d3_data_visualizer.py:71: unused attribute 'colors' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\visualizer\d3_data_visualizer.py:100: unused attribute 'show_settings' (60% confidence)
C:\Users\fabia\PycharmProjects\MDSuite\mdsuite\visualizer\znvis_visualizer.py:107: unused method '_prepare_species' (60% confidence)

@SamTov
Copy link
Member

SamTov commented Feb 23, 2022

Funnily the constant 60% confident makes me less confident in all of them 😄

@PythonFZ
Copy link
Member Author

Funnily the constant 60% confident makes me less confident in all of them 😄

I guess most of the lines mentioned here aren't unused code. But it might still be worth looking at them. If you are confident there is no legacy code we can also close this.

@SamTov
Copy link
Member

SamTov commented Feb 24, 2022

No no I was just joking because all of them say 60% confidence which just makes me less confident. Some of this is definitely legacy code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants