# kwix
<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
## Developer Guide
### Setup
``` sh
# create conda environment
$ mamba env create -f env.yml
# update conda environment
$ mamba env update -n kwix --file env.yml
```
### Install
``` sh
pip install -e .
# install from pypi
pip install kwix
```
### nbdev
``` sh
# activate conda environment
$ conda activate kwix
# make sure the kwix package is installed in development mode
$ pip install -e .
# make changes under nbs/ directory
# ...
# compile to have changes apply to the kwix package
$ nbdev_prepare
```
### Publishing
``` sh
# publish to pypi
$ nbdev_pypi
# publish to conda
$ nbdev_conda --build_args '-c conda-forge'
$ nbdev_conda --mambabuild --build_args '-c conda-forge -c dsm-72'
```
# Usage
## Installation
Install latest from the GitHub
[repository](https://github.com/dsm-72/kwix):
``` sh
$ pip install git+https://github.com/dsm-72/kwix.git
```
or from [conda](https://anaconda.org/dsm-72/kwix)
``` sh
$ conda install -c dsm-72 kwix
```
or from [pypi](https://pypi.org/project/kwix/)
``` sh
$ pip install kwix
```
## Documentation
Documentation can be found hosted on GitHub
[repository](https://github.com/dsm-72/kwix)
[pages](https://dsm-72.github.io/kwix/). Additionally you can find
package manager specific guidelines on
[conda](https://anaconda.org/dsm-72/kwix) and
[pypi](https://pypi.org/project/kwix/) respectively.
## Toy Inheritance
``` python
@dataclass
class Foo(KWix):
_: KW_ONLY
a: int = 1
b: int = 2
c: int = 3
@dataclass
class Qux(KWix):
_: KW_ONLY
q: str = -2
u: str = -1
x: int = 0
```
``` python
@dataclass
class Bar(Foo):
_: KW_ONLY
x: int = 7
y: int = 8
z: int = 9
@dataclass
class Baz(Bar, Qux):
_: KW_ONLY
a: int = 6
b: int = 7
q: int = 0
@dataclass
class Auz(Bar):
_: KW_ONLY
```
## Seaborn
Since Seaborn Clustermap passes all extra keyword-arguments to Heatmap
using [`KWix`](https://dsm-72.github.io/kwix/mixs.html#kwix) can make it
easy to know what these parameters are and easy to pass them accordingly
``` python
@dataclass
class SeabornHeatmap(KWix):
_: KW_ONLY
# heatmap parameters
vmin: Optional[float] = None
vmax: Optional[float] = None
cmap: Optional[str] = 'inferno'
center: Optional[float] = None
robust: bool = True
annot: Optional[bool] = None
fmt: Optional[str] = '.2g'
annot_kws: Optional[dict] = None
linewidths: Optional[float] = 0
linecolor: Optional[str] = 'white'
cbar: bool = True
cbar_kws: Optional[dict] = None
cbar_ax: Optional['Axes'] = None
square: bool = False
xticklabels: Union[bool, list, str, bool] = 'auto'
yticklabels: Union[bool, list, str, bool] = 'auto'
mask: Optional[Union['NPArray', 'DataFrame']] = None
ax: Optional['Axes'] = None
```
``` python
@dataclass
class SeabornClustermap(SeabornHeatmap, KWix):
_: KW_ONLY
# clustermap parameters
pivot_kws: Optional[dict] = None
method: 'LinkageMethod' = 'SINGLE'
metric: 'PDistMetric' = 'CORRELATION'
z_score: Optional[int] = 0
standard_scale: Optional[int] = None
figsize: Tuple[int, int] = (10, 10)
cbar_kws: Optional[dict] = None
row_cluster: bool = True
col_cluster: bool = True
row_linkage: Optional[dict] = None
col_linkage: Optional[dict] = None
row_colors: Optional[dict] = None
col_colors: Optional[dict] = None
mask: Optional[dict] = None
dendrogram_ratio: float = 0.2
colors_ratio: float = 0.03
cbar_pos: 'CBarPos' = (0.02, 0.8, 0.05, 0.18)
tree_kws: Optional[dict] = None
```
``` python
clstmap = SeabornClustermap()
```
``` python
clstmap.curvals()
```
{'cbar_kws': None,
'cbar_pos': (0.02, 0.8, 0.05, 0.18),
'col_cluster': True,
'col_colors': None,
'col_linkage': None,
'colors_ratio': 0.03,
'dendrogram_ratio': 0.2,
'figsize': (10, 10),
'mask': None,
'method': 'SINGLE',
'metric': 'CORRELATION',
'pivot_kws': None,
'row_cluster': True,
'row_colors': None,
'row_linkage': None,
'standard_scale': None,
'tree_kws': None,
'z_score': 0}
``` python
clstmap.inhvals()
```
{'annot': None,
'annot_kws': None,
'ax': None,
'cbar': True,
'cbar_ax': None,
'center': None,
'cmap': 'inferno',
'fmt': '.2g',
'linecolor': 'white',
'linewidths': 0,
'robust': True,
'square': False,
'vmax': None,
'vmin': None,
'xticklabels': 'auto',
'yticklabels': 'auto'}
``` python
clstmap.allvals()
```
{'annot': None,
'annot_kws': None,
'ax': None,
'cbar': True,
'cbar_ax': None,
'cbar_kws': None,
'cbar_pos': (0.02, 0.8, 0.05, 0.18),
'center': None,
'cmap': 'inferno',
'col_cluster': True,
'col_colors': None,
'col_linkage': None,
'colors_ratio': 0.03,
'dendrogram_ratio': 0.2,
'figsize': (10, 10),
'fmt': '.2g',
'linecolor': 'white',
'linewidths': 0,
'mask': None,
'method': 'SINGLE',
'metric': 'CORRELATION',
'pivot_kws': None,
'robust': True,
'row_cluster': True,
'row_colors': None,
'row_linkage': None,
'square': False,
'standard_scale': None,
'tree_kws': None,
'vmax': None,
'vmin': None,
'xticklabels': 'auto',
'yticklabels': 'auto',
'z_score': 0}
Raw data
{
"_id": null,
"home_page": "https://github.com/dsm-72/regsyn",
"name": "regsyn",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": "",
"keywords": "reg syn register synonyms alias function globals pollution globsyn regsyn regsyns",
"author": "dsm-72",
"author_email": "sumner.magruder@yale.edu",
"download_url": "https://files.pythonhosted.org/packages/42/51/22979dfe5d37a72c29afc33577f3c5a760dbb2acfbf07c4b01e436594886/regsyn-0.0.3.tar.gz",
"platform": null,
"description": "# kwix\n\n<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->\n\n## Developer Guide\n\n### Setup\n\n``` sh\n# create conda environment\n$ mamba env create -f env.yml\n\n# update conda environment\n$ mamba env update -n kwix --file env.yml\n```\n\n### Install\n\n``` sh\npip install -e .\n\n# install from pypi\npip install kwix\n```\n\n### nbdev\n\n``` sh\n# activate conda environment\n$ conda activate kwix\n\n# make sure the kwix package is installed in development mode\n$ pip install -e .\n\n# make changes under nbs/ directory\n# ...\n\n# compile to have changes apply to the kwix package\n$ nbdev_prepare\n```\n\n### Publishing\n\n``` sh\n# publish to pypi\n$ nbdev_pypi\n\n# publish to conda\n$ nbdev_conda --build_args '-c conda-forge'\n$ nbdev_conda --mambabuild --build_args '-c conda-forge -c dsm-72'\n```\n\n# Usage\n\n## Installation\n\nInstall latest from the GitHub\n[repository](https://github.com/dsm-72/kwix):\n\n``` sh\n$ pip install git+https://github.com/dsm-72/kwix.git\n```\n\nor from [conda](https://anaconda.org/dsm-72/kwix)\n\n``` sh\n$ conda install -c dsm-72 kwix\n```\n\nor from [pypi](https://pypi.org/project/kwix/)\n\n``` sh\n$ pip install kwix\n```\n\n## Documentation\n\nDocumentation can be found hosted on GitHub\n[repository](https://github.com/dsm-72/kwix)\n[pages](https://dsm-72.github.io/kwix/). Additionally you can find\npackage manager specific guidelines on\n[conda](https://anaconda.org/dsm-72/kwix) and\n[pypi](https://pypi.org/project/kwix/) respectively.\n\n## Toy Inheritance\n\n``` python\n@dataclass\nclass Foo(KWix):\n _: KW_ONLY\n a: int = 1\n b: int = 2\n c: int = 3\n\n@dataclass\nclass Qux(KWix):\n _: KW_ONLY\n q: str = -2\n u: str = -1\n x: int = 0\n```\n\n``` python\n@dataclass\nclass Bar(Foo):\n _: KW_ONLY\n x: int = 7\n y: int = 8\n z: int = 9\n\n@dataclass\nclass Baz(Bar, Qux):\n _: KW_ONLY\n a: int = 6\n b: int = 7\n q: int = 0\n\n@dataclass\nclass Auz(Bar):\n _: KW_ONLY\n```\n\n## Seaborn\n\nSince Seaborn Clustermap passes all extra keyword-arguments to Heatmap\nusing [`KWix`](https://dsm-72.github.io/kwix/mixs.html#kwix) can make it\neasy to know what these parameters are and easy to pass them accordingly\n\n``` python\n@dataclass\nclass SeabornHeatmap(KWix):\n _: KW_ONLY \n # heatmap parameters\n vmin: Optional[float] = None\n vmax: Optional[float] = None\n cmap: Optional[str] = 'inferno'\n center: Optional[float] = None\n robust: bool = True\n annot: Optional[bool] = None\n fmt: Optional[str] = '.2g'\n annot_kws: Optional[dict] = None\n linewidths: Optional[float] = 0\n linecolor: Optional[str] = 'white'\n cbar: bool = True\n cbar_kws: Optional[dict] = None\n cbar_ax: Optional['Axes'] = None\n square: bool = False\n xticklabels: Union[bool, list, str, bool] = 'auto'\n yticklabels: Union[bool, list, str, bool] = 'auto'\n mask: Optional[Union['NPArray', 'DataFrame']] = None\n ax: Optional['Axes'] = None\n```\n\n``` python\n@dataclass\nclass SeabornClustermap(SeabornHeatmap, KWix):\n _: KW_ONLY \n # clustermap parameters\n pivot_kws: Optional[dict] = None\n method: 'LinkageMethod' = 'SINGLE'\n metric: 'PDistMetric' = 'CORRELATION'\n z_score: Optional[int] = 0\n standard_scale: Optional[int] = None\n figsize: Tuple[int, int] = (10, 10)\n cbar_kws: Optional[dict] = None\n row_cluster: bool = True\n col_cluster: bool = True\n row_linkage: Optional[dict] = None\n col_linkage: Optional[dict] = None\n row_colors: Optional[dict] = None\n col_colors: Optional[dict] = None\n mask: Optional[dict] = None\n dendrogram_ratio: float = 0.2\n colors_ratio: float = 0.03\n cbar_pos: 'CBarPos' = (0.02, 0.8, 0.05, 0.18)\n tree_kws: Optional[dict] = None\n```\n\n``` python\nclstmap = SeabornClustermap()\n```\n\n``` python\nclstmap.curvals()\n```\n\n {'cbar_kws': None,\n 'cbar_pos': (0.02, 0.8, 0.05, 0.18),\n 'col_cluster': True,\n 'col_colors': None,\n 'col_linkage': None,\n 'colors_ratio': 0.03,\n 'dendrogram_ratio': 0.2,\n 'figsize': (10, 10),\n 'mask': None,\n 'method': 'SINGLE',\n 'metric': 'CORRELATION',\n 'pivot_kws': None,\n 'row_cluster': True,\n 'row_colors': None,\n 'row_linkage': None,\n 'standard_scale': None,\n 'tree_kws': None,\n 'z_score': 0}\n\n``` python\nclstmap.inhvals()\n```\n\n {'annot': None,\n 'annot_kws': None,\n 'ax': None,\n 'cbar': True,\n 'cbar_ax': None,\n 'center': None,\n 'cmap': 'inferno',\n 'fmt': '.2g',\n 'linecolor': 'white',\n 'linewidths': 0,\n 'robust': True,\n 'square': False,\n 'vmax': None,\n 'vmin': None,\n 'xticklabels': 'auto',\n 'yticklabels': 'auto'}\n\n``` python\nclstmap.allvals()\n```\n\n {'annot': None,\n 'annot_kws': None,\n 'ax': None,\n 'cbar': True,\n 'cbar_ax': None,\n 'cbar_kws': None,\n 'cbar_pos': (0.02, 0.8, 0.05, 0.18),\n 'center': None,\n 'cmap': 'inferno',\n 'col_cluster': True,\n 'col_colors': None,\n 'col_linkage': None,\n 'colors_ratio': 0.03,\n 'dendrogram_ratio': 0.2,\n 'figsize': (10, 10),\n 'fmt': '.2g',\n 'linecolor': 'white',\n 'linewidths': 0,\n 'mask': None,\n 'method': 'SINGLE',\n 'metric': 'CORRELATION',\n 'pivot_kws': None,\n 'robust': True,\n 'row_cluster': True,\n 'row_colors': None,\n 'row_linkage': None,\n 'square': False,\n 'standard_scale': None,\n 'tree_kws': None,\n 'vmax': None,\n 'vmin': None,\n 'xticklabels': 'auto',\n 'yticklabels': 'auto',\n 'z_score': 0}\n",
"bugtrack_url": null,
"license": "Apache Software License 2.0",
"summary": "Register Synonyms",
"version": "0.0.3",
"project_urls": {
"Homepage": "https://github.com/dsm-72/regsyn"
},
"split_keywords": [
"reg",
"syn",
"register",
"synonyms",
"alias",
"function",
"globals",
"pollution",
"globsyn",
"regsyn",
"regsyns"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6b06f021789a7cda66f7e263fa36ecaa5a63dd033f520c3709ea6121186480fa",
"md5": "5150c3f879b1597439f579400bd356f2",
"sha256": "f27e6f3bc8220789871c668c408fcd97ff3cc76053368fef717e8124c4738246"
},
"downloads": -1,
"filename": "regsyn-0.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5150c3f879b1597439f579400bd356f2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 8726,
"upload_time": "2023-09-07T16:15:22",
"upload_time_iso_8601": "2023-09-07T16:15:22.536249Z",
"url": "https://files.pythonhosted.org/packages/6b/06/f021789a7cda66f7e263fa36ecaa5a63dd033f520c3709ea6121186480fa/regsyn-0.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "425122979dfe5d37a72c29afc33577f3c5a760dbb2acfbf07c4b01e436594886",
"md5": "a4acd67f11bebfe602633df66b78f521",
"sha256": "60557c502eef168629b44bcc03d3786d1dacf9bd60aeb96ac614469349e63fe6"
},
"downloads": -1,
"filename": "regsyn-0.0.3.tar.gz",
"has_sig": false,
"md5_digest": "a4acd67f11bebfe602633df66b78f521",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 9371,
"upload_time": "2023-09-07T16:15:23",
"upload_time_iso_8601": "2023-09-07T16:15:23.820779Z",
"url": "https://files.pythonhosted.org/packages/42/51/22979dfe5d37a72c29afc33577f3c5a760dbb2acfbf07c4b01e436594886/regsyn-0.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-07 16:15:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dsm-72",
"github_project": "regsyn",
"github_not_found": true,
"lcname": "regsyn"
}