-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
81 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
{ | ||
"python.formatting.provider": "yapf" | ||
"editor.defaultFormatter": "eeyore.yapf", | ||
"python.testing.pytestArgs": [ | ||
"test" | ||
], | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": true, | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,48 @@ | ||
[project] | ||
name = "njab" | ||
authors = [{ name = "Henry Webel", email = "[email protected]" }] | ||
description = "not Just Another Biomarker" | ||
readme = "README.md" | ||
requires-python = ">=3.8" | ||
keywords = ["bioinformatics", "biomarker"] | ||
license = { file = "LICENSE" } | ||
classifiers = [ | ||
"License :: OSI Approved :: MIT License", | ||
"Intended Audience :: Healthcare Industry", | ||
"Intended Audience :: Science/Research", | ||
"Programming Language :: Python :: 3", | ||
"Topic :: Scientific/Engineering :: Bio-Informatics", | ||
] | ||
dependencies = [ | ||
"omegaconf", | ||
"lifelines", | ||
"numpy", | ||
"pandas", | ||
"scikit-learn", | ||
"statsmodels", | ||
"umap-learn", | ||
"matplotlib", | ||
"mrmr_selection", | ||
"pingouin", | ||
"seaborn", | ||
] | ||
dynamic = ["version"] | ||
|
||
[project.optional-dependencies] | ||
docs = [ | ||
"sphinx", | ||
"sphinx-book-theme", | ||
"myst-nb", | ||
"ipywidgets", | ||
"sphinx-new-tab-link!=0.2.2", | ||
] | ||
|
||
[project.urls] | ||
"Bug Tracker" = "https://github.com/RasmussenLab/njab/issues" | ||
"Homepage" = "https://github.com/RasmussenLab/njab" | ||
|
||
[build-system] | ||
requires = ["setuptools>=42", "wheel"] | ||
build-backend = "setuptools.build_meta" | ||
requires = ["setuptools>=64", "setuptools_scm>=8"] | ||
|
||
[tool.setuptools_scm] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,3 @@ | ||
[metadata] | ||
name = njab | ||
version = 0.0.4 | ||
description = not Just Another Biomarker | ||
long_description = file: README.md | ||
long_description_content_type = text/markdown | ||
author = Henry Webel | ||
author_email = "Henry Webel" <[email protected]> | ||
license = MIT | ||
license_files = LICENSE | ||
classifiers = | ||
License :: OSI Approved :: MIT License | ||
Intended Audience :: Healthcare Industry | ||
Intended Audience :: Science/Research | ||
Programming Language :: Python :: 3 | ||
Topic :: Scientific/Engineering :: Bio-Informatics | ||
|
||
[options] | ||
requires_python = ">=3.8" | ||
package_dir = | ||
=src | ||
packages = find: | ||
include_package_data = False | ||
install_requires = | ||
omegaconf | ||
lifelines | ||
numpy | ||
pandas | ||
scikit-learn | ||
statsmodels | ||
umap-learn | ||
matplotlib | ||
mrmr_selection | ||
pingouin | ||
seaborn | ||
|
||
[options.extras_require] | ||
docs = | ||
sphinx | ||
sphinx-book-theme | ||
myst-nb | ||
ipywidgets | ||
sphinx-new-tab-link!=0.2.2 | ||
|
||
[options.packages.find] | ||
where = src | ||
exclude = | ||
test* | ||
|
||
[yapf] | ||
based_on_style = pep8 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
import pandas as pd | ||
|
||
import njab | ||
|
||
|
||
def test_thousands_display(): | ||
njab.pandas.set_pandas_options() | ||
s = pd.Series([1_000_000]) | ||
assert str(s)[4:13] == '1,000,000' | ||
|
||
|
||
def test_combine_value_counts(): | ||
df = pd.DataFrame({'a': [1, 2, 2, 2, 3, 3, 3], 'b': [1, 1, 1, 2, 2, 3, 3]}) | ||
exp = {'a': {1: 1, 2: 3, 3: 3}, 'b': {1: 3, 2: 2, 3: 2}} | ||
act = njab.pandas.combine_value_counts(df).to_dict() | ||
assert act == exp |