nipraxis-spring-2022 / diagnostics-Lemanics

Lemanics' team project for the Nipraxis course
1 stars 6 forks source link

Review #22

Open ZviBaratz opened 2 years ago

ZviBaratz commented 2 years ago

Hi everyone,

Great job on your group project! :tada:


:sparkles: README and basic usage instructions. :sparkles: Using PRs to collaborate on a shared codebase. :sparkles: Installable Python package. :sparkles: Scripts are executable and have the expected output format. :sparkles: The code is organized and broken down into modules of reasonably sized functions. :sparkles: Basic tests and passing CI.


Here are some notes from looking at the repo:

def median_detector(*args, **kwargs): ...

DETECTORS = { "IQR": iqr_detector, "median": median_detector, }

def compute_outliers(detector: str = "IQR", *args, **kwargs): detector_func = DETECTORS[detector] ....


Generally speaking, avoid relying on `globals()` to access (let alone change) anything.

@matthew-brett
celprov commented 2 years ago

Thanks a lot @ZviBaratz for all those useful comments. I have a question out of curiosity : why should we prefer pathlib over os.path ?

ZviBaratz commented 2 years ago

Hi @celprov, thank you. I'm glad you found it useful.

Regarding pathlib, this is merely a recommendation - pathlib is more modern and more specialized (i.e. oriented specifically to facilitate filesystem path operations), while the os module is more low-level and general-purpose. There are numerous operations that are much simpler to execute using pathlib and will result in more readable code.

I also wanted to take back my comment regarding string templating (using format over f-strings), this is more of a personal preference, really.