Skip to content

Commit

Permalink
ci: add docs build check
Browse files Browse the repository at this point in the history
  • Loading branch information
kenibrewer committed Apr 26, 2024
1 parent 14f78a2 commit 8aae6dd
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 26 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,23 @@ env:
TARGET_PYTHON_VERSION: "3.9"

jobs:
docs-check:
# This job is used to check the documentation build with strict mode enabled
name: Docs check
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup python, and load cache
uses: ./.github/actions/setup-env
with:
python-version: ${{ env.TARGET_PYTHON_VERSION }}
cache-pre-commit: false
cache-venv: true
setup-poetry: true
install-deps: true
- name: Build documentation
run: poetry run mkdocs build --strict
quality-test:
# This job is used to run pre-commit checks to ensure that all files are
# are formatted correctly.
Expand Down
4 changes: 2 additions & 2 deletions pycytominer/cyto_utils/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def label_compartment(cp_features, compartment, metadata_cols):
cp_features : list of str
All features being used.
compartment : str
Measured compartment.
Measured compartment.
metadata_cols : list
Columns that should be considered metadata.
Expand Down Expand Up @@ -150,7 +150,7 @@ def drop_outlier_features(
"Metadata_treatment == 'control'" (include all quotes).
If "all", use all samples to calculate.
outlier_cutoff : int or float, default 500
see https://github.com/cytomining/pycytominer/issues/237 for details.
see https://github.com/cytomining/pycytominer/issues/237 for details.
Threshold to remove features if absolute values is greater
Returns
Expand Down
46 changes: 22 additions & 24 deletions pycytominer/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,13 @@ def normalize(
If provided, will write normalized profiles as a specified file type (either CSV or parquet).
If not specified and output_file is provided, then the file will be outputed as CSV as default.
compression_options : str or dict, optional
Contains compression options as input to
pd.DataFrame.to_csv(compression=compression_options). pandas version >= 1.2.
Contains compression options as input to `pd.DataFrame.to_csv(compression=compression_options)`.
float_format : str, optional
Decimal precision to use in writing output file as input to
pd.DataFrame.to_csv(float_format=float_format). For example, use "%.3g" for 3
decimal precision.
mad_robustize_epsilon: float, optional
The mad_robustize fudge factor parameter. The function only uses
this variable if method = "mad_robustize". Set this to 0 if
The mad_robustize fudge factor parameter. The function only uses this variable if method = "mad_robustize". Set this to 0 if
mad_robustize generates features with large values.
spherize_center : bool
If the function should center data before sphering (aka whitening). The
Expand All @@ -86,36 +84,36 @@ def normalize(
Examples
--------
```python
import pandas as pd
from pycytominer import normalize
data_df = pd.DataFrame(
{
"Metadata_plate": ["a", "a", "a", "a", "b", "b", "b", "b"],
"Metadata_treatment": [
"drug",
"drug",
"control",
"control",
"drug",
"drug",
"control",
"control",
],
"x": [1, 2, 8, 2, 5, 5, 5, 1],
"y": [3, 1, 7, 4, 5, 9, 6, 1],
"z": [1, 8, 2, 5, 6, 22, 2, 2],
"zz": [14, 46, 1, 6, 30, 100, 2, 2],
}
).reset_index(drop=True)
data_df = pd.DataFrame({
"Metadata_plate": ["a", "a", "a", "a", "b", "b", "b", "b"],
"Metadata_treatment": [
"drug",
"drug",
"control",
"control",
"drug",
"drug",
"control",
"control",
],
"x": [1, 2, 8, 2, 5, 5, 5, 1],
"y": [3, 1, 7, 4, 5, 9, 6, 1],
"z": [1, 8, 2, 5, 6, 22, 2, 2],
"zz": [14, 46, 1, 6, 30, 100, 2, 2],
}).reset_index(drop=True)
normalized_df = normalize(
profiles=data_df,
features=["x", "y", "z", "zz"],
meta_features="infer",
samples="Metadata_treatment == 'control'",
method="standardize"
method="standardize",
)
```
"""
# Load Data
profiles = load_profiles(profiles)
Expand Down

0 comments on commit 8aae6dd

Please sign in to comment.