Skip to content

Commit

Permalink
fix docstrings after review
Browse files Browse the repository at this point in the history
  • Loading branch information
gwaybio committed Feb 4, 2022
1 parent 92da3a0 commit 442219e
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 9 deletions.
23 changes: 14 additions & 9 deletions pycytominer/cyto_utils/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ def infer_delim(file):
"""
Sniff the delimiter in the given file
Arguments
---------
Parameters
----------
file : str
File name
Expand All @@ -33,8 +33,8 @@ def load_profiles(profiles):
"""
Unless a dataframe is provided, load the given profile dataframe from path or string
Arguments
---------
Parameters
----------
profiles : {str, pandas.DataFrame}
file location or actual pandas dataframe of profiles
Expand All @@ -55,8 +55,8 @@ def load_platemap(platemap, add_metadata_id=True):
"""
Unless a dataframe is provided, load the given platemap dataframe from path or string
Arguments
---------
Parameters
----------
platemap : pandas dataframe
location or actual pandas dataframe of platemap file
Expand All @@ -65,7 +65,7 @@ def load_platemap(platemap, add_metadata_id=True):
Return
------
platemap : pandas DataFrame
platemap : pandas.core.frame.DataFrame
pandas DataFrame of profiles
"""
if not isinstance(platemap, pd.DataFrame):
Expand Down Expand Up @@ -93,12 +93,17 @@ def load_npz(npz_file, fallback_feature_prefix="DP"):
If the npz file does not exist, this function returns an empty dataframe.
Arguments
---------
Parameters
----------
npz_file : str
file path to the compressed output (typically DeepProfiler output)
fallback_feature_prefix :str
a string to prefix all features [default: "DP"].
Return
------
df : pandas.core.frame.DataFrame
pandas DataFrame of profiles
"""
try:
npz = np.load(npz_file, allow_pickle=True)
Expand Down
5 changes: 5 additions & 0 deletions pycytominer/cyto_utils/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ def check_compression_method(compression):
----------
compression : str
The category of compression options available
Returns
-------
None
Asserts available options
"""
assert (
compression in compress_options
Expand Down
5 changes: 5 additions & 0 deletions pycytominer/cyto_utils/single_cell_ingest_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ def assert_linking_cols_complete(linking_cols="default", compartments="default")
compartments : str or list, default "default"
Which compartments used in the experiment.
Returns
-------
None
Asserts linking columns are appropriately defined
.. note::
assert_linking_cols_complete() does not check if columns are present
"""
Expand Down
7 changes: 7 additions & 0 deletions pycytominer/operations/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ def fit(self, X, y=None):
def transform(self, X, y=None):
"""Perform the sphering transform
Parameters
----------
X : pd.core.frame.DataFrame
Profile dataframe to be transformed using the precompiled weights
y : None
Has no effect; only used for consistency in sklearn transform API
Returns
-------
pandas.core.frame.DataFrame
Expand Down

0 comments on commit 442219e

Please sign in to comment.