{
"info": {
"author": "Lincoln Randall McFarland",
"author_email": "lrm@starbug.com",
"bugtrack_url": null,
"classifiers": [
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Astronomy"
],
"description": "# Python Boost wrappers\n\n## [starbug.com coordinate Python wrappers](https://github.com/lrmcfarland/Coordinates)\n\nThis module contains the source to generate Python wrappers for the\nC++ classes in [libCoords](https://github.com/lrmcfarland/Coordinates/tree/adds-pypi-v2/libCoords) using Boost. This\nlibrary is assumed to have been built first. coords.cpp contains the\nBoost macros that are used to generate the wrappers. setup.py builds\nthem.\n\nThere are some differences from the [manual](https://github.com/lrmcfarland/Coordinates/tree/master/Python/Manual) version,\nlike not having a coords.Error exception but using RuntimeError\ninstead. The static unit vectors have also moved from coords.Ux\nto coords.Cartesian.Ux. Similarly for Uy, Uz, and Uo.\n\n# To Build\n\nThe build is done using make on the command line. There are targets\nfor clean and test. See the Makefile for details.\n\nThis Makefile will not build libCoords. That must be done before this.\n\nsetup.py expects to find libCoords.dylib in libCoords and Boost\nto be in /usr/local. See setup.py for details.\n\n## Build Tools\n\n### [Boost](http://www.boost.org)\n\nThe Boost Python library must be installed before this build will\nwork.\n\n\n#### On OS X with brew\n\nThe easiest way I found to install and maintain boost on OS X is to\nuse [homebrew](http://brew.sh). Open the boost-python bottle. The\npython wrappers are not in the \"regular\" boost bottle.\n\n\n```\n$ brew install boost-python --with-python3\n```\n\n#### On CentOS with yum\n\n```\nsudo yum install boost-devel\n```\n\n#### On Ubuntu with apt-get\n\n\n```\nsudo apt-get install libboost-all-dev\n```\n\n\n#### from source\n\nTo built and install from the\n[boost](http://www.boost.org/users/history/version_1_56_0.html)\nsource, unpack the tar-ball in /usr/local\n\n```\ncd /usr/local/boost_1_56_0\n\n./bootstrap.sh\n./b2\nsudo ./b2 install\n```\n\nThe boost files are now in /usr/local/include/boost and\n/usr/local/lib/libboost_*. python/Boost/setup.py sets BOOST_ROOT to\npoint there. On OS X brew doctor will notice and complain about this.\n\n\n# The run time environment with setenv.sh\n\nOn the local host, relative to this directory, the runtime environment\nexpects libCoords to be built.\n\nOn OS X, this needs to be on the DYLD_LIBRARY_PATH.\nOn Linux, this needs to be on the LD_LIBRARY_PATH.\n\nThe PYTHONPATH must contain the boost coords.so.\n\nsetenv.sh will detect the platform using uname and set the appropriate\nlibrary path and use COORDS_ORIGIN environment variable to find\ncoords.so. If COORDS_ORIGIN is not set, it will assume it is relative\nto this directory.\n\n## An Interactive Session\n\nYou can use pylaunch.sh to set up an interactive session.\n\nHere I use the spherical coordinates with the radius of the earth, the\nlatitude (which needs to be converted to the theta angle from the\npositive z axis), and longitude of two locations to calculate the\ndistance between them.\n\n```\n$ ./pylaunch.sh\n# COORDS_ROOT not set. Using ../..\n# coords.so: ../../python/Boost/build/lib.macosx-10.9-intel-2.7/coords.so\n# DYLD_LIBRARY_PATH :../../libCoords\n# PYTHONPATH :../../python/Boost/build/lib.macosx-10.9-intel-2.7\n\nPython 2.7.5 (default, Mar 9 2014, 22:15:05)\n[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import coords\n>>> keplers = coords.spherical(6371, coords.angle(90) - coords.angle(37, 27, 13), coords.angle(-122, 10, 55))\n>>> booksinc = coords.spherical(6371, coords.angle(90) - coords.angle(37, 23, 32.4852), coords.angle(-122, 4, 46.2252))\n>>> print keplers - booksinc\n11.323561.4649123.282\n\n```\n\n\n# To test a component wiht pylaunch.sh\n\nUse pylaunch.sh to call setenv.sh. Select one of the associated python\nunittest scripts, e.g. test_Cartesian.py, along with the usual command\nline options like -v\n\n```\n$ ./pylaunch.sh test_angle.py -v\n\n# COORDS_ROOT not set. Using ../..\n# coords.so: ../../Python/Boost/build/lib.macosx-10.9-intel-2.7/coords.so\n# DYLD_LIBRARY_PATH :../../libCoords\n# PYTHONPATH :../../Python/Boost/build/lib.macosx-10.9-intel-2.7\n\ntest_accessors_1 (__main__.TestAngle)\nTest value accessors 1 ... ok\ntest_accessors_1b (__main__.TestAngle)\nTest value accessor exception ... skipped 'TODO Boost.Python.ArgumentError'\ntest_accessors_2 (__main__.TestAngle)\nTest radians accessor negative ... ok\ntest_accessors_2a (__main__.TestAngle)\nTest radians accessor exception ... skipped 'TODO Boost.Python.ArgumentError'\ntest_angle1_eq_angle1 (__main__.TestAngle)\nTest richcompare operator==() ... ok\n...\nTest latitude += latitude ... ok\ntest_inplace_add_2 (__main__.TestLatitude)\nTest latitude += angle ... ok\ntest_inplace_add_over_limit (__main__.TestLatitude)\nTest latitude += latitude ... ok\n\n----------------------------------------------------------------------\nRan 49 tests in 0.003s\n\nOK (skipped=5)\n```\n\n# To run a single unit test\n\nFrom the command line, pass in the UnitTest test harness and test name,\ne.g. TestCartesian, test_default_constructor to the test script\n\n```\n$ ./pylaunch.sh test_Cartesian.py -v TestCartesian.test_default_constructor\n\n# COORDS_ROOT not set. Using ../..\n# coords.so: ../../Python/Boost/build/lib.macosx-10.9-intel-2.7/coords.so\n# DYLD_LIBRARY_PATH :../../libCoords\n# PYTHONPATH :../../Python/Boost/build/lib.macosx-10.9-intel-2.7\n\ntest_default_constructor (__main__.TestCartesian)\nTest default constructor ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n```\n\n\n# To test all components\n\n```\n$ ./test_coords.sh -v\n```\n\n\n# PyPI dist\n\nThe Makefile as a dist target to build the python distribution files.\n\n```\n$ pwd\n.../Coordinates/Python/Boost\n\n$ make dist\nenv ARCHFLAGS=\"-arch x86_64\" python setup.py build\n\n/Users/lrm/.pyenv/versions/3.7.0/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'long_description_content_type'\n warnings.warn(msg)\n```\n\nTODO: It complains about long_description_content_type, but it doesn't render correctly with out it.\n\nMake clean will remove them\n\n```\n$ make clean\nrm -f -r build dist coords.egg-info\n```\n\n\n# PyPI\n\nI use the [packaging python projects\ninstructions](https://packaging.python.org/tutorials/packaging-projects/)\nto push builds to a PyPI distribution.\n\nYou will need to increment the version number in setup.py to push a new package.\n\nUse twine to upload the distribution\n\n\n## To Test PyPI\n\n```\n$ twine upload --repository-url https://test.pypi.org/legacy/ dist/*\nEnter your username: lrmcfarland\nEnter your password:\nUploading distributions to https://pypi.org/\nUploading coords-1.0.1-cp37-cp37m-macosx_10_13_x86_64.whl\n100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 129k/129k [00:02<00:00, 58.4kB/s]\nUploading coords-1.0.1.tar.gz\n100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 13.8k/13.8k [00:01<00:00, 7.83kB/s]\n```\n\nTo install the test distribution\n\n```\n\n$ pip install -i https://test.pypi.org/simple/ starbug.coords\nLooking in indexes: https://test.pypi.org/simple/\nCollecting coords\n Downloading https://test-files.pythonhosted.org/packages/e3/6f/0476d2792045eb0185e039e52b29991fc32bb9c4ceabc178053d11c276e0/coords-1.0-cp37-cp37m-macosx_10_13_x86_64.whl (123kB)\n 100% |\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 133kB 1.4MB/s\nInstalling collected packages: coords\nSuccessfully installed coords-1.0\n\n```\n\n## To PyPI\n\n```\n$ twine upload dist/*\n```\n\nTo install the test distribution\n\n```\n$ pip install -i https://pypi.org/project/ starbug.coords\n```\n\n\n# To use\n\n```\n(test-coords) $ python\nPython 3.7.0 (default, Jul 1 2018, 12:43:10)\n[Clang 9.1.0 (clang-902.0.39.2)] on darwin\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\n>>> import starbug.coords as coords\n\n>>> keplers = coords.spherical(6371, coords.angle(90) - coords.angle(37, 27, 13), coords.angle(-122, 10, 55))\n\n>>> booksinc = coords.spherical(6371, coords.angle(90) - coords.angle(37, 23, 32.4852), coords.angle(-122, 4, 46.2252))\n\n>>> str(keplers - booksinc)\n'11.323561.4649123.282'\n\n```\n\n\n",
"description_content_type": "text/markdown",
"docs_url": null,
"download_url": "",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/lrmcfarland/Coordinates",
"keywords": "",
"license": "",
"maintainer": "",
"maintainer_email": "",
"name": "starbug.coords",
"package_url": "https://pypi.org/project/starbug.coords/",
"platform": "",
"project_url": "https://pypi.org/project/starbug.coords/",
"project_urls": {
"Homepage": "https://github.com/lrmcfarland/Coordinates"
},
"release_url": "https://pypi.org/project/starbug.coords/1.0.0/",
"requires_dist": null,
"requires_python": "",
"summary": "coords package",
"version": "1.0.0"
},
"last_serial": 4862636,
"releases": {
"1.0.0": [
{
"comment_text": "",
"digests": {
"md5": "2a94a3a1acdb9067f2a1e26a543ae83c",
"sha256": "6ac54232b4a52be4473f3aff5e7892801933de46e2e6827133299ce1648066d0"
},
"downloads": -1,
"filename": "starbug.coords-1.0.0-cp37-cp37m-macosx_10_13_x86_64.whl",
"has_sig": false,
"md5_digest": "2a94a3a1acdb9067f2a1e26a543ae83c",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": null,
"size": 124363,
"upload_time": "2019-02-25T02:29:00",
"url": "https://files.pythonhosted.org/packages/23/35/9a19fbba4d9b0f43db15b5a8a21d39bb0ff3818ff108627e05ca632562ed/starbug.coords-1.0.0-cp37-cp37m-macosx_10_13_x86_64.whl"
},
{
"comment_text": "",
"digests": {
"md5": "afb5a6c2ef4a56222ef440686409cdc1",
"sha256": "26878a53aa9732b023ff651c52c9b78092356895edc3d17cf7de9c2f79bd2097"
},
"downloads": -1,
"filename": "starbug.coords-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "afb5a6c2ef4a56222ef440686409cdc1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7865,
"upload_time": "2019-02-25T02:29:02",
"url": "https://files.pythonhosted.org/packages/d6/17/99635c4a91a3444adc7a5d4b7243a1962a33acb5f7049e8bc4aa2a062ded/starbug.coords-1.0.0.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "2a94a3a1acdb9067f2a1e26a543ae83c",
"sha256": "6ac54232b4a52be4473f3aff5e7892801933de46e2e6827133299ce1648066d0"
},
"downloads": -1,
"filename": "starbug.coords-1.0.0-cp37-cp37m-macosx_10_13_x86_64.whl",
"has_sig": false,
"md5_digest": "2a94a3a1acdb9067f2a1e26a543ae83c",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": null,
"size": 124363,
"upload_time": "2019-02-25T02:29:00",
"url": "https://files.pythonhosted.org/packages/23/35/9a19fbba4d9b0f43db15b5a8a21d39bb0ff3818ff108627e05ca632562ed/starbug.coords-1.0.0-cp37-cp37m-macosx_10_13_x86_64.whl"
},
{
"comment_text": "",
"digests": {
"md5": "afb5a6c2ef4a56222ef440686409cdc1",
"sha256": "26878a53aa9732b023ff651c52c9b78092356895edc3d17cf7de9c2f79bd2097"
},
"downloads": -1,
"filename": "starbug.coords-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "afb5a6c2ef4a56222ef440686409cdc1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7865,
"upload_time": "2019-02-25T02:29:02",
"url": "https://files.pythonhosted.org/packages/d6/17/99635c4a91a3444adc7a5d4b7243a1962a33acb5f7049e8bc4aa2a062ded/starbug.coords-1.0.0.tar.gz"
}
]
}