Skip to content

Commit

Permalink
Merge pull request #4 from quadbio/update_package
Browse files Browse the repository at this point in the history
Update package
  • Loading branch information
Marius1311 authored Oct 16, 2024
2 parents b5b5f7b + 31a5424 commit a669331
Show file tree
Hide file tree
Showing 11 changed files with 126 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,23 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {
"ExecuteTime": {
"end_time": "2021-05-31T09:25:02.307098Z",
"start_time": "2021-05-31T09:25:02.291254Z"
}
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The autoreload extension is already loaded. To reload it, use:\n",
" %reload_ext autoreload\n"
]
}
],
"source": [
"%load_ext autoreload\n",
"%autoreload 2"
Expand All @@ -72,7 +81,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"metadata": {
"ExecuteTime": {
"end_time": "2021-05-31T09:25:05.984402Z",
Expand All @@ -84,7 +93,7 @@
"source": [
"# import single-cell packages\n",
"import scanpy as sc\n",
"from fancypackage import DATA_DIR, FIG_DIR"
"from fancypackage.ul import DATA_DIR, FIG_DIR"
]
},
{
Expand All @@ -96,14 +105,14 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Running Scanpy 1.9.3, on 2024-04-24 17:16.\n"
"Running Scanpy 1.10.3, on 2024-10-16 17:32.\n"
]
}
],
Expand All @@ -120,7 +129,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -158,14 +167,14 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/Users/mlange/Projects/analysis_template/data\n"
"/nas/groups/treutlein/USERS/mlange/github/analysis_template/data\n"
]
}
],
Expand All @@ -188,7 +197,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "py310",
"display_name": "analysis_template",
"language": "python",
"name": "python3"
},
Expand All @@ -202,7 +211,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3.11.10"
},
"toc": {
"base_numbering": 1,
Expand Down
7 changes: 5 additions & 2 deletions src/fancypackage/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from .core import DATA_DIR, FIG_DIR
from importlib.metadata import version

__all__ = ["DATA_DIR", "FIG_DIR"]
from . import pl, pp, tl, ul

__all__ = ["pl", "pp", "tl", "ul"]
__version__ = version("fancypackage")
3 changes: 0 additions & 3 deletions src/fancypackage/core/__init__.py

This file was deleted.

1 change: 1 addition & 0 deletions src/fancypackage/pl/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .basic import BasicClass, basic_plot
63 changes: 63 additions & 0 deletions src/fancypackage/pl/basic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
from anndata import AnnData


def basic_plot(adata: AnnData) -> int:
"""Generate a basic plot for an AnnData object.
Parameters
----------
adata
The AnnData object to preprocess.
Returns
-------
Some integer value.
"""
print("Import matplotlib and implement a plotting function here.")
return 0


class BasicClass:
"""A basic class.
Parameters
----------
adata
The AnnData object to preprocess.
"""

my_attribute: str = "Some attribute."
my_other_attribute: int = 0

def __init__(self, adata: AnnData):
print("Implement a class here.")

def my_method(self, param: int) -> int:
"""A basic method.
Parameters
----------
param
A parameter.
Returns
-------
Some integer value.
"""
print("Implement a method here.")
return 0

def my_other_method(self, param: str) -> str:
"""Another basic method.
Parameters
----------
param
A parameter.
Returns
-------
Some integer value.
"""
print("Implement a method here.")
return ""
1 change: 1 addition & 0 deletions src/fancypackage/pp/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .basic import basic_preproc
17 changes: 17 additions & 0 deletions src/fancypackage/pp/basic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from anndata import AnnData


def basic_preproc(adata: AnnData) -> int:
"""Run a basic preprocessing on the AnnData object.
Parameters
----------
adata
The AnnData object to preprocess.
Returns
-------
Some integer value.
"""
print("Implement a preprocessing function here.")
return 0
1 change: 1 addition & 0 deletions src/fancypackage/tl/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .basic import basic_tool
17 changes: 17 additions & 0 deletions src/fancypackage/tl/basic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from anndata import AnnData


def basic_tool(adata: AnnData) -> int:
"""Run a tool on the AnnData object.
Parameters
----------
adata
The AnnData object to preprocess.
Returns
-------
Some integer value.
"""
print("Implement a tool to run on the AnnData object.")
return 0
1 change: 1 addition & 0 deletions src/fancypackage/ul/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .constants import DATA_DIR, FIG_DIR
File renamed without changes.

0 comments on commit a669331

Please sign in to comment.