{ "info": { "author": "Azat Ibrakov", "author_email": "azatibrakov@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "topo\n====\n\n[![](https://travis-ci.org/lycantropos/topo.svg?branch=master)](https://travis-ci.org/lycantropos/topo \"Travis CI\")\n[![](https://ci.appveyor.com/api/projects/status/github/lycantropos/topo?branch=master&svg=true)](https://ci.appveyor.com/project/lycantropos/topo \"AppVeyor\")\n[![](https://codecov.io/gh/lycantropos/topo/branch/master/graph/badge.svg)](https://codecov.io/gh/lycantropos/topo \"Codecov\")\n[![](https://img.shields.io/github/license/lycantropos/topo.svg)](https://github.com/lycantropos/topo/blob/master/LICENSE \"License\")\n[![](https://badge.fury.io/py/topo.svg)](https://badge.fury.io/py/topo \"PyPI\")\n\nIn what follows\n- `python` is an alias for `python3.5` or any later\nversion (`python3.6` and so on),\n- `pypy` is an alias for `pypy3.5` or any later\nversion (`pypy3.6` and so on).\n\nInstallation\n------------\n\nInstall the latest `pip` & `setuptools` packages versions:\n- with `CPython`\n ```bash\n python -m pip install --upgrade pip setuptools\n ```\n- with `PyPy`\n ```bash\n pypy -m pip install --upgrade pip setuptools\n ```\n\n### User\n\nDownload and install the latest stable version from `PyPI` repository:\n- with `CPython`\n ```bash\n python -m pip install --upgrade topo\n ```\n- with `PyPy`\n ```bash\n pypy -m pip install --upgrade topo\n ```\n\n### Developer\n\nDownload the latest version from `GitHub` repository\n```bash\ngit clone https://github.com/lycantropos/topo.git\ncd topo\n```\n\nInstall:\n- with `CPython`\n ```bash\n python setup.py install\n ```\n- with `PyPy`\n ```bash\n pypy setup.py install\n ```\n\nUsage\n-----\n\n`topo` provides\n\n- hashable,\n- partially ordered by `<=` (\"is subset of\") and `>=` (\"is superset of\") relations,\n- strictly ordered by `<` (\"is strict subset of\") and `>` (\"is strict superset of\") relations\n\nmodels & objects:\n\n- `EMPTY_SET`: for set with no elements\n ```python\n >>> from topo.base import EMPTY_SET\n >>> EMPTY_SET\n EmptySet()\n >>> str(EMPTY_SET)\n '{}'\n >>> EMPTY_SET <= EMPTY_SET\n True\n >>> EMPTY_SET < EMPTY_SET\n False\n >>> 1 in EMPTY_SET\n False\n # and so on for every object\n ```\n- `DiscreteSet`: for discrete sets of hashable objects \n(similar to built-in `set`s)\n ```python\n >>> from topo.discrete import DiscreteSet\n >>> binary_set = DiscreteSet(0, 1)\n >>> binary_set\n DiscreteSet(0, 1)\n >>> str(binary_set)\n '{0, 1}'\n >>> EMPTY_SET <= binary_set\n True\n >>> binary_set < EMPTY_SET\n False\n >>> 0 in binary_set\n True\n >>> 10 in binary_set\n False\n ```\n- `Interval`: for intervals of floating point numbers\n ```python\n >>> from topo.continuous import Interval\n >>> unit_segment = Interval(0, 1)\n >>> unit_segment\n Interval(0, 1, left_end_inclusive=True, right_end_inclusive=True)\n >>> str(unit_segment)\n '[0, 1]'\n >>> binary_set <= unit_segment\n True\n >>> unit_segment < binary_set\n False\n >>> 0.5 in unit_segment\n True\n >>> 10 in unit_segment\n False\n ```\n\nwith next operators overloaded:\n\n- `|`: for sets union\n ```python\n >>> unit_segment | binary_set\n Interval(0, 1, left_end_inclusive=True, right_end_inclusive=True)\n ```\n since `unit_segment` contains `binary_set` elements.\n\n- `-`: for sets difference\n ```python\n >>> unit_segment - binary_set\n Interval(0, 1, left_end_inclusive=False, right_end_inclusive=False)\n ```\n as we can see both ends were excluded.\n\n- `&`: for sets intersection\n ```python\n >>> unit_segment & binary_set\n DiscreteSet(0, 1)\n ```\n\nAlso used in conditionals sets will evaluate to `False` \nif they are considered empty and `True` otherwise:\n\n```python\n>>> if not EMPTY_SET:\n print('Hello World!')\n else:\n print('Something went wrong.')\nHello World!\n```\n\n\nDevelopment\n-----------\n\n### Bumping version\n\n#### Preparation\n\nInstall\n[bump2version](https://github.com/c4urself/bump2version#installation).\n\n#### Pre-release\n\nChoose which version number category to bump following [semver\nspecification](http://semver.org/).\n\nTest bumping version\n```bash\nbump2version --dry-run --verbose $CATEGORY\n```\n\nwhere `$CATEGORY` is the target version number category name, possible\nvalues are `patch`/`minor`/`major`.\n\nBump version\n```bash\nbump2version --verbose $CATEGORY\n```\n\nThis will set version to `major.minor.patch-alpha`. \n\n#### Release\n\nTest bumping version\n```bash\nbump2version --dry-run --verbose --tag release\n```\n\nBump version\n```bash\nbump2version --verbose --tag release\n```\n\nThis will set version to `major.minor.patch` and add `Git` tag.\n\n#### Notes\n\nTo avoid inconsistency between branches and pull requests,\nbumping version should be merged into `master` branch as separate pull\nrequest.\n\n### Running tests\n\nPlain:\n- with `CPython`\n ```bash\n python setup.py test\n ```\n- with `PyPy`\n ```bash\n pypy setup.py test\n ```\n\nInside `Docker` container:\n- with `CPython`\n ```bash\n docker-compose --file docker-compose.cpython.yml up\n ```\n- with `PyPy`\n ```bash\n docker-compose --file docker-compose.pypy.yml up\n ```\n\n`Bash` script (e.g. can be used in `Git` hooks):\n- with `CPython`\n ```bash\n ./run-tests.sh\n ```\n or\n ```bash\n ./run-tests.sh cpython\n ```\n\n- with `PyPy`\n ```bash\n ./run-tests.sh pypy\n ```\n\n`PowerShell` script (e.g. can be used in `Git` hooks):\n- with `CPython`\n ```powershell\n .\\run-tests.ps1\n ```\n or\n ```powershell\n .\\run-tests.ps1 cpython\n ```\n- with `PyPy`\n ```powershell\n .\\run-tests.ps1 pypy\n ```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/lycantropos/topo/archive/master.zip", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/lycantropos/topo/", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "topo", "package_url": "https://pypi.org/project/topo/", "platform": "", "project_url": "https://pypi.org/project/topo/", "project_urls": { "Download": "https://github.com/lycantropos/topo/archive/master.zip", "Homepage": "https://github.com/lycantropos/topo/" }, "release_url": "https://pypi.org/project/topo/0.1.1/", "requires_dist": [ "reprit (>=0.0.0)" ], "requires_python": ">=3.5", "summary": "Topology models.", "version": "0.1.1" }, "last_serial": 5115007, "releases": { "0.0.0": [ { "comment_text": "", "digests": { "md5": "37e5a8391a46fee38ba8426873996e6c", "sha256": "275acf4f4de486523496d897c663f039dcc5a4a419ae4534a0f91fdec4a36327" }, "downloads": -1, "filename": "topo-0.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "37e5a8391a46fee38ba8426873996e6c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 3105, "upload_time": "2019-01-29T11:43:28", "url": "https://files.pythonhosted.org/packages/db/fc/9f886040bc3c87b824c39046359dd17982c8242eef8413652d11f78d8173/topo-0.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "960325878aa6440a5e86d10340a81339", "sha256": "c080a4064f4f3df4628f6265f63dc952a32672a02cb0864a82f6a0fe8d076787" }, "downloads": -1, "filename": "topo-0.0.0.tar.gz", "has_sig": false, "md5_digest": "960325878aa6440a5e86d10340a81339", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 2610, "upload_time": "2019-01-29T11:43:31", "url": "https://files.pythonhosted.org/packages/78/52/c0378d274f1f0e92e508ed832862af3711082e44fedc97022d7d1d1dde29/topo-0.0.0.tar.gz" } ], "0.0.1": [ { "comment_text": "", "digests": { "md5": "8a80d9b151875f4b57d84a21fcc3b508", "sha256": "a7ba9868b815ae6124a44c710ea1cbb779e09f0beebb4ff26117f16c3f88feb8" }, "downloads": -1, "filename": "topo-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8a80d9b151875f4b57d84a21fcc3b508", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 9743, "upload_time": "2019-02-08T14:31:33", "url": "https://files.pythonhosted.org/packages/8d/1b/1c4a03608ea81b404d361661f27cec9e79c9f8a0c97b8904ce0d9b8bd935/topo-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9174dfe9e4fc68f5d240d084e111fe76", "sha256": "f0d56cb1d10f0655b4719eb9b1bb81e57e8ade648c3445fe0bfe659db48641fb" }, "downloads": -1, "filename": "topo-0.0.1.tar.gz", "has_sig": false, "md5_digest": "9174dfe9e4fc68f5d240d084e111fe76", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 9772, "upload_time": "2019-02-08T14:31:35", "url": "https://files.pythonhosted.org/packages/0c/6b/3797002e6bc2f2d282e57acb973da56b9efa0db8e24dc48290da31412055/topo-0.0.1.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "958a1447d8ed727c981e32d87edbefef", "sha256": "f607ed39559bc924fab01cd7b135467a8d015c1b6eb07528578d6998a81bc3ec" }, "downloads": -1, "filename": "topo-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "958a1447d8ed727c981e32d87edbefef", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 8996, "upload_time": "2019-02-22T14:20:11", "url": "https://files.pythonhosted.org/packages/ff/5c/e13b84d8da97417a83384ece7887cc2cdb140a7fbeeba7c0b129022524c9/topo-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e5af7b6a40d5dd53f3867e952603a8aa", "sha256": "67d743e92dfcee4046c6f386dbb435badf27278ad56a9bd529ae5ae47a8bfa6e" }, "downloads": -1, "filename": "topo-0.1.0.tar.gz", "has_sig": false, "md5_digest": "e5af7b6a40d5dd53f3867e952603a8aa", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 9249, "upload_time": "2019-02-22T14:20:13", "url": "https://files.pythonhosted.org/packages/55/45/ac46ef8f4d4d92c93f6620a5fd5aa3d4ed4900ab6ef54bfd85d8a6cd1c66/topo-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "c598dfb31c68c75506657e045aeff2dc", "sha256": "74a471d3cde273c97f6c60e0eeffac5991609c857bacd2c1a09d0802ecadb6d2" }, "downloads": -1, "filename": "topo-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "c598dfb31c68c75506657e045aeff2dc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 8992, "upload_time": "2019-04-08T18:54:43", "url": "https://files.pythonhosted.org/packages/48/57/d89c940d24db527278195c246cd3fb38d015b381fadfabda9e66bfe3c60a/topo-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bbfe736d25122b6738be485998f70214", "sha256": "d872fb1d7dbb81128749bc1ee5539b0f3a3d3e0dd2e9a3e962d97b0a9f4724ad" }, "downloads": -1, "filename": "topo-0.1.1.tar.gz", "has_sig": false, "md5_digest": "bbfe736d25122b6738be485998f70214", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 9250, "upload_time": "2019-04-08T18:54:44", "url": "https://files.pythonhosted.org/packages/ce/1d/faa021d2e9996118c56e20252988fd8c9adb0be3a8f484594255cc847f43/topo-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c598dfb31c68c75506657e045aeff2dc", "sha256": "74a471d3cde273c97f6c60e0eeffac5991609c857bacd2c1a09d0802ecadb6d2" }, "downloads": -1, "filename": "topo-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "c598dfb31c68c75506657e045aeff2dc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 8992, "upload_time": "2019-04-08T18:54:43", "url": "https://files.pythonhosted.org/packages/48/57/d89c940d24db527278195c246cd3fb38d015b381fadfabda9e66bfe3c60a/topo-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bbfe736d25122b6738be485998f70214", "sha256": "d872fb1d7dbb81128749bc1ee5539b0f3a3d3e0dd2e9a3e962d97b0a9f4724ad" }, "downloads": -1, "filename": "topo-0.1.1.tar.gz", "has_sig": false, "md5_digest": "bbfe736d25122b6738be485998f70214", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 9250, "upload_time": "2019-04-08T18:54:44", "url": "https://files.pythonhosted.org/packages/ce/1d/faa021d2e9996118c56e20252988fd8c9adb0be3a8f484594255cc847f43/topo-0.1.1.tar.gz" } ] }