Closed berquist closed 6 months ago
Making all fixtures scoped to the session (since none seem to return anything mutable) appears to help, but time is actually only down from 7 and a half to 7 minutes. So there was not a substantial amount of duplicate work being done in setup after all. xdist over 8 workers is still one and a half minutes.
Also, if no one has complained about local testing time, the effort for adding markers may not be worth it. CI seems pretty fast thanks to using the splits.
Feel free to close this if you agree that it isn't worthwhile.
37.12s call tests/featurize/test_batch.py::TestExceptions::test_batch_summary_featurizer_exception
22.68s call tests/featurize/test_batch.py::TestBatchSummaryFeaturizer::test_summary_featurize_with_json_overall
20.21s call tests/cli/test_cli.py::TestCLI::test_cli_interactive_plotter_coops
19.96s setup tests/cohp/test_analyze.py::TestAnalyse::test_all_attributes_cdf_comp_range_coop
17.37s call tests/featurize/test_batch.py::TestBatchSummaryFeaturizer::test_summary_featurize_orbitalwise
16.61s call tests/featurize/test_batch.py::TestBatchSummaryFeaturizer::test_summary_featurize_without_json
9.57s call tests/cohp/test_describe.py::TestCalcQualityDescribeWarnings::test_warnings
9.05s call tests/featurize/test_batch.py::TestBatchSummaryFeaturizer::test_summary_featurize_with_json_antibonding
9.00s call tests/featurize/test_batch.py::TestBatchSummaryFeaturizer::test_summary_featurize_with_json_bonding
8.82s call tests/featurize/test_batch.py::TestBatchSummaryFeaturizer::test_summary_featurize_with_json
8.35s call tests/featurize/test_batch.py::TestBatchStructureGraphs::test_batch_structure_graphs_cation_anion_bonds
8.19s call tests/featurize/test_core.py::TestFeaturizeLobsterpy::test_featurize_mp463
8.15s call tests/featurize/test_batch.py::TestBatchStructureGraphs::test_batch_structure_graphs_all_bonds
7.90s call tests/featurize/test_batch.py::TestBatchCoxxFingerprint::test_fp_cobi
7.72s call tests/featurize/test_batch.py::TestBatchCoxxFingerprint::test_fp_cohp_bonding
7.62s call tests/featurize/test_batch.py::TestBatchCoxxFingerprint::test_fp_cohp_overall
7.54s call tests/featurize/test_batch.py::TestBatchCoxxFingerprint::test_fp_coop
7.40s call tests/featurize/test_batch.py::TestBatchSummaryFeaturizer::test_summary_featurize_with_no_bonds
6.81s call tests/plotting/test_plotting.py::TestInteractiveCohpPlotter::test_plot_colors
6.76s setup tests/cohp/test_describe.py::TestDescribe::test_text
6.44s call tests/cli/test_cli.py::TestCLI::test_nongz_file_cli
6.01s call tests/structuregraph/test_graph.py::TestGraph::test_graph_nacl_without_add_data
6.00s call tests/structuregraph/test_graph.py::TestGraph::test_graph_nacl_all
5.98s call tests/cli/test_cli.py::TestCLI::test_cli_interactive_plotter_cobi
5.85s call tests/structuregraph/test_graph.py::TestGraph::test_graph_nacl_close_fermi
5.74s call tests/structuregraph/test_graph.py::TestGraph::test_graph_nacl_cation_anion
5.59s call tests/structuregraph/test_graph.py::TestGraph::test_graph_cdf_all
5.57s setup tests/plotting/test_plotting.py::TestInteractiveCohpPlotter::test_add_all_relevant_cohps_nacl_cobi_orb
5.50s setup tests/cohp/test_analyze.py::TestAnalyse::test_all_attributes_analyse_nacl_comp_range_cobi
5.49s setup tests/cohp/test_analyze.py::TestAnalyse::test_all_attributes_nacl_comp_range_orbital
5.44s setup tests/plotting/test_plotting.py::TestInteractiveCohpPlotter::test_add_all_relevant_cohps_nacl_cobi
5.00s setup tests/cohp/test_analyze.py::TestAnalyse::test_icohp_sum_nacl
4.96s setup tests/cohp/test_analyze.py::TestAnalyse::test_all_attributes_nacl_comp_range_cobi_orbital
4.93s call tests/plotting/test_plotting.py::TestInteractiveCohpPlotter::test_add_all_relevant_cohps_k3sb
4.86s call tests/structuregraph/test_graph.py::TestGraph::test_graph_cdf_close_fermi
4.81s setup tests/cohp/test_analyze.py::TestAnalyse::test_all_attributes_k3sb_all_coop_orb
4.70s setup tests/plotting/test_plotting.py::TestInteractiveCohpPlotter::test_add_all_relevant_cohps_cdf
4.64s setup tests/cohp/test_analyze.py::TestAnalyse::test_icohp_sum_cdf
4.32s call tests/cli/test_cli.py::TestCLI::test_calc_quality_summary_nacl
4.32s setup tests/plotting/test_plotting.py::TestInteractiveCohpPlotter::test_add_all_relevant_cohps_k3sb
4.08s setup tests/cohp/test_analyze.py::TestAnalyse::test_all_attributes_k3sb
3.87s call tests/featurize/test_core.py::TestFeaturizeCOXX::test_featurize_k3sb_coxx
3.73s setup tests/cohp/test_analyze.py::TestAnalyse::test_all_attributes_k3sb_all
3.72s setup tests/cohp/test_analyze.py::TestAnalyse::test_all_attributes_k3sb_all_cobi
3.50s setup tests/cohp/test_describe.py::TestDescribe::test_plot
3.20s setup tests/cohp/test_analyze.py::TestAnalyse::test_final_dicts
3.11s setup tests/cohp/test_analyze.py::TestAnalyse::test_all_attributes_nasbf6_anbd
In any case, thank you, @berquist ! I will close this then.
See https://github.com/openjournals/joss-reviews/issues/6286#issuecomment-1961996406:
Moving the discussion here.
Here are the results for running
python -m pytest --durations=0
. It looks like the ~generally slowest tests are those having to do with featurization, but many are slow insetup
. Based upon the common fixture names intest_write_description
andtest_text
, I'm certain the slowness is in performing reanalysis each time the fixture is used. I think setting these fixtures to session scope will help without having to implement a cache.