theislab / chemCPA

Code for "Predicting Cellular Responses to Novel Drug Perturbations at a Single-Cell Resolution", NeurIPS 2022.
https://arxiv.org/abs/2204.13545
MIT License
88 stars 23 forks source link

Add profiling #38

Closed siboehm closed 2 years ago

siboehm commented 2 years ago

@MxMstrmn If you can, have a quick look and merge

siboehm commented 2 years ago

@MxMstrmn what was the reason why all the imports from compert in seml_sweep_icb.py are local (=happen inside the function)? This causes seml to not upload the corresponding python files to the MongoDB. Uploading them is useful for profiling, as the profiler only stores the line number. Hence the profile is useless if the underlying python file changes later and the previous version isn't stored.

Example: https://github.com/theislab/chemical_CPA/blob/main/compert/seml_sweep_icb.py#L56

Why are these not global imports (ie they happen at the top of the file with all the other imports)?