Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add module docstrings for __about__.py, __init__.py, constants.py, and utils.py #398

Merged
merged 5 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion cubids/__about__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Base module variables."""
"""Base module variables for CuBIDS.

This module defines the base variables for the CuBIDS package, including version,
package name, copyright, credits, and URLs.

Attributes
----------
__version__ : str
The version of the CuBIDS package.
__packagename__ : str
The name of the CuBIDS package.
__copyright__ : str
The copyright information for the CuBIDS package.
__credits__ : str
The credits for the CuBIDS package.
__url__ : str
The URL for the CuBIDS package repository.
DOWNLOAD_URL : str
The URL to download the CuBIDS package.
"""
try:
from cubids._version import __version__
except ImportError:
Expand Down
35 changes: 34 additions & 1 deletion cubids/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,37 @@
"""Top-level package for CuBIDS."""
"""Top-level package for CuBIDS.

This module initializes the CuBIDS package and imports its main submodules and attributes.

Submodules
----------
cli : module
Command-line interface for CuBIDS.
config : module
Configuration utilities for CuBIDS.
constants : module
Constants used throughout the CuBIDS package.
cubids : module
Core functionalities of the CuBIDS package.
metadata_merge : module
Utilities for merging metadata in CuBIDS.
utils : module
Utility functions for CuBIDS.
validator : module
Validation utilities for CuBIDS.
workflows : module
Workflows for CuBIDS operations.

Attributes
----------
__version__ : str
The version of the CuBIDS package.
__packagename__ : str
The name of the CuBIDS package.
__copyright__ : str
The copyright information for the CuBIDS package.
__credits__ : str
The credits for the CuBIDS package.
"""

from cubids import (
cli,
Expand Down
21 changes: 14 additions & 7 deletions cubids/constants.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
"""Constants for CuBIDS."""
"""Constants for CuBIDS.

This module defines various constants used throughout the CuBIDS package.

Attributes
----------
ID_VARS : set of str
Names of identifier variables. Used to place EntitySet and ParamGroup at
the beginning of a dataframe but both are hardcoded in the relevant function.
NON_KEY_ENTITIES : set of str
Entities that should not be used to group parameter sets.
IMAGING_PARAMS : set of str
List of metadata fields merged in `metadata_merge.py`.
"""

# Names of identifier variables.
# Used to place EntitySet and ParamGroup at the beginning of a dataframe,
# but both are hardcoded in the relevant function.
ID_VARS = set(["EntitySet", "ParamGroup", "FilePath"])
# Entities that should not be used to group parameter sets
NON_KEY_ENTITIES = set(["subject", "session", "extension"])
# Multi-dimensional keys SliceTiming XXX: what is this line about?
# List of metadata fields and parameters (calculated by CuBIDS)
# Not sure what this specific list is used for.
IMAGING_PARAMS = set(
[
"ParallelReductionFactorInPlane",
Expand Down
5 changes: 4 additions & 1 deletion cubids/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
"""Miscellaneous utility functions for CuBIDS."""
"""Miscellaneous utility functions for CuBIDS.

This module provides various utility functions used throughout the CuBIDS package.
"""

import re
from pathlib import Path
Expand Down
Loading