Skip to content

🚧 update imputation module#61

Draft
enryH wants to merge 15 commits intomainfrom
updt_imputation_module
Draft

🚧 update imputation module#61
enryH wants to merge 15 commits intomainfrom
updt_imputation_module

Conversation

@enryH
Copy link
Copy Markdown
Collaborator

@enryH enryH commented Feb 16, 2026

Summary

Update imputation module.

List of changes proposed in this PR (pull-request)

  • Update diff_regulation_ancova.ipynb tutorial in docs/api_examples
  • Update pandas code

Checks

@enryH enryH force-pushed the updt_imputation_module branch from b35530c to ee2c08d Compare February 17, 2026 07:54
@enryH enryH changed the title 🎨 format and docstrings 🚧 update imputation module Feb 17, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the imputation functionality and adds new documentation/tests to support the updated API.

Changes:

  • Refactors acore.imputation_analysis imputation functions (KNN + normal-distribution based) with new parameters and updated pandas handling.
  • Adds pytest coverage for imputation_KNN and imputation_normal_distribution.
  • Adds a new “Imputation” API example (both .py and .ipynb) and links it from the docs index.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 16 comments.

Show a summary per file
File Description
src/acore/imputation_analysis/__init__.py Refactors imputation implementations and public signatures; adds logging/constants.
tests/test_imputation.py Introduces tests for normal-distribution imputation and KNN imputation.
docs/index.md Adds the imputation tutorial to the docs TOC.
docs/api_examples/imputation.py New Jupytext-based imputation tutorial script.
docs/api_examples/imputation.ipynb New notebook version of the imputation tutorial.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +12 to +17
"- k Neareast Neighbour imputation can also be used with other types of data\n",
"- the replacement from the normal distrubtion on the sample level is typical to\n",
" normally distributed samples from massspectrometer data (in the log2 space)\n",
"\n",
"Refers to the [`acore.imputation`](acore.imputation) module."
]
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The notebook intro references the acore.imputation module, but the implementation and imports use acore.imputation_analysis. Please update the referenced module path so the docs don’t link to a nonexistent module.

Copilot uses AI. Check for mistakes.
Comment on lines +434 to +438
"! does not account for groups\n",
"imputation_normal_distribution(\n",
" data=omics_and_y,\n",
" drop_cols=[group],\n",
")"
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code cell contains ! does not account for groups which Jupyter will interpret as a shell command and error. It should be a comment (e.g., start with #) so the notebook can execute cleanly.

Copilot uses AI. Check for mistakes.
["desired", "cutoff"],
[(2206.6954572254326, 0.3), (1684.3585255006, 0.6), (837.3284651386293, 0.9)],
)
def test_test_imputation_KNN(example_data, desired, cutoff):
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test name has a duplicated prefix (test_test_imputation_KNN). Renaming to test_imputation_KNN would keep naming consistent with other tests and improve readability.

Copilot uses AI. Check for mistakes.
Comment on lines +24 to +26
#
# Refers to the [`acore.imputation`](acore.imputation) module.

Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tutorial text references acore.imputation, but the actual module used/imported is acore.imputation_analysis (and there doesn’t appear to be an acore.imputation package). This link/name should be updated so the docs don’t point to a nonexistent module.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, to do. but keep it for the diff for now

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

Successfully merging this pull request may close these issues.

2 participants