Skip to content

Commit

Permalink
Move and restructure constants
Browse files Browse the repository at this point in the history
  • Loading branch information
Marius1311 committed Nov 10, 2024
1 parent 5578cf9 commit 6119e1a
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ dmypy.json
*.gmt
*.gmx

data/
# Directories to ignore
figures/

# OS specifics
Expand Down
10 changes: 5 additions & 5 deletions analysis/[INITIALS]-[DATE]_sample_notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
},
"outputs": [],
"source": [
"from fancypackage.ul import DATA_DIR"
"from fancypackage import FilePaths"
]
},
{
Expand Down Expand Up @@ -124,7 +124,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Any data should be stored in the `data` directory, or somewhere centrally on the cluster. The `data` directly is acessible from anywhere in this repo via `DATA_DIR`: "
"Any data should be stored in the `data` directory, or somewhere centrally on the cluster. The `data` directly is acessible from anywhere in this repo via `FilePaths`: "
]
},
{
Expand All @@ -136,12 +136,12 @@
"name": "stdout",
"output_type": "stream",
"text": [
"/nas/groups/treutlein/USERS/mlange/github/analysis_template/data\n"
"/nas/groups/treutlein/USERS/mlange/github/data\n"
]
}
],
"source": [
"print(DATA_DIR)"
"print(FilePaths.DATA)"
]
},
{
Expand Down Expand Up @@ -178,7 +178,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.10"
"version": "3.12.7"
},
"toc": {
"base_numbering": 1,
Expand Down
Empty file.
Empty file added data/dataset_1/raw/.gitkeep
Empty file.
Empty file added data/dataset_1/results/.gitkeep
Empty file.
3 changes: 2 additions & 1 deletion src/fancypackage/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from importlib.metadata import version

from . import pl, pp, tl, ul
from ._constants import FilePaths

__all__ = ["pl", "pp", "tl", "ul"]
__all__ = ["pl", "pp", "tl", "ul", "FilePaths"]
__version__ = version("fancypackage")
11 changes: 11 additions & 0 deletions src/fancypackage/_constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from pathlib import Path


class FilePaths:
"""Paths to the data and figures directories."""

ROOT = Path(__file__).parents[3].resolve()

DATA = ROOT / "data"
FIGURES = ROOT / "figures"
DATASET_1 = DATA / "dataset_1"
2 changes: 1 addition & 1 deletion src/fancypackage/ul/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .constants import DATA_DIR, FIG_DIR
from .basic import basic_utility
17 changes: 17 additions & 0 deletions src/fancypackage/ul/basic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from anndata import AnnData


def basic_utility(adata: AnnData) -> int:
"""Run a utility function
Parameters
----------
adata
The AnnData object to do something with
Returns
-------
Some integer value.
"""
print("Implement a utility function here.")
return 0
7 changes: 0 additions & 7 deletions src/fancypackage/ul/constants.py

This file was deleted.

0 comments on commit 6119e1a

Please sign in to comment.