cosmology.api


Namecosmology.api JSON
Version 0.1.0 PyPI version JSON
download
home_page
SummaryCosmology API standard
upload_time2023-05-17 18:35:08
maintainer
docs_urlNone
author
requires_python>=3.9
licenseBSD 3-Clause License Copyright (c) 2022, Nathaniel Starkman and Nicolas Tessore All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords cosmology api
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Cosmology API
=============

There are a lot of (Python) cosmology libraries out there, from big projects --
including `Astropy <https://docs.astropy.org/en/stable/cosmology/index.html>`_,
`CLASS <http://class-code.net>`_, and `CAMB
<https://camb.readthedocs.io/en/latest/>`_ -- down to small personal scripts.
These libraries perform many of the same tasks, but they all have different
interfaces, and different ways of doing things. This makes it hard to switch
between libraries, and nearly impossible to write code that works with multiple
libraries.

The Cosmology API for Python solves this problem, providing detailed interfaces
for cosmology codes, from individual methods and functions up to fully-featured
cosmology objects, even whole libraries. Best of all, using the Cosmology API
does not require any run-time dependencies, even this library!

With the Cosmology API you can **write code that works with anything that
implements the API**, i.e many different cosmology libraries. We provide the
easy-to-use, well-defined descriptions, you can build functions that work with
any supporting library. For example

.. skip: next
.. code-block:: python

   # No implementation, just a description of the interface!
   from cosmology.api import StandardCosmology


   def flat_angular_diameter_distance(
       cosmo: StandardCosmology[Array, Array], z: Array
   ) -> Array:
       # Do some cosmology with any object that implements the API
       if cosmo.Omega_k != 0:
           raise ValueError("This function only works for flat cosmologies")
       return cosmo.comoving_distance(z) / (1 + z)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "cosmology.api",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "Nathaniel Starkman <n.starkman@mail.utoronto.ca>, Nicolas Tessore <n.tessore@ucl.ac.uk>",
    "keywords": "cosmology,API",
    "author": "",
    "author_email": "Nathaniel Starkman <n.starkman@mail.utoronto.ca>, Nicolas Tessore <n.tessore@ucl.ac.uk>",
    "download_url": "https://files.pythonhosted.org/packages/2b/58/94ce26c3adfe91a4c33f95bfa2a66abed3f16f30c94d78db0a97f6ea970a/cosmology.api-0.1.0.tar.gz",
    "platform": null,
    "description": "Cosmology API\n=============\n\nThere are a lot of (Python) cosmology libraries out there, from big projects --\nincluding `Astropy <https://docs.astropy.org/en/stable/cosmology/index.html>`_,\n`CLASS <http://class-code.net>`_, and `CAMB\n<https://camb.readthedocs.io/en/latest/>`_ -- down to small personal scripts.\nThese libraries perform many of the same tasks, but they all have different\ninterfaces, and different ways of doing things. This makes it hard to switch\nbetween libraries, and nearly impossible to write code that works with multiple\nlibraries.\n\nThe Cosmology API for Python solves this problem, providing detailed interfaces\nfor cosmology codes, from individual methods and functions up to fully-featured\ncosmology objects, even whole libraries. Best of all, using the Cosmology API\ndoes not require any run-time dependencies, even this library!\n\nWith the Cosmology API you can **write code that works with anything that\nimplements the API**, i.e many different cosmology libraries. We provide the\neasy-to-use, well-defined descriptions, you can build functions that work with\nany supporting library. For example\n\n.. skip: next\n.. code-block:: python\n\n   # No implementation, just a description of the interface!\n   from cosmology.api import StandardCosmology\n\n\n   def flat_angular_diameter_distance(\n       cosmo: StandardCosmology[Array, Array], z: Array\n   ) -> Array:\n       # Do some cosmology with any object that implements the API\n       if cosmo.Omega_k != 0:\n           raise ValueError(\"This function only works for flat cosmologies\")\n       return cosmo.comoving_distance(z) / (1 + z)\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License  Copyright (c) 2022, Nathaniel Starkman and Nicolas Tessore All rights reserved.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ",
    "summary": "Cosmology API standard",
    "version": "0.1.0",
    "project_urls": {
        "documentation": "https://cosmology.readthedocs.org",
        "homepage": "https://cosmology.readthedocs.org",
        "repository": "https://github.com/cosmology-api/cosmology.api"
    },
    "split_keywords": [
        "cosmology",
        "api"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ff947b9a1e3e88d9538de07d67be95d93978119310e2bcd203337eaa456a0de4",
                "md5": "de0e144b6a2f99e26b76cc9f61ecc518",
                "sha256": "9ec21546990dea1ab1a8e799763fa378e3bb366f6c14f466f836d99d77077167"
            },
            "downloads": -1,
            "filename": "cosmology.api-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "de0e144b6a2f99e26b76cc9f61ecc518",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 18051,
            "upload_time": "2023-05-17T18:35:05",
            "upload_time_iso_8601": "2023-05-17T18:35:05.899224Z",
            "url": "https://files.pythonhosted.org/packages/ff/94/7b9a1e3e88d9538de07d67be95d93978119310e2bcd203337eaa456a0de4/cosmology.api-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2b5894ce26c3adfe91a4c33f95bfa2a66abed3f16f30c94d78db0a97f6ea970a",
                "md5": "0b11ecb6fa9cb3fccf8dde6c64691a4f",
                "sha256": "a2ca2e3d765d694c7ebaff9fa734c2c4d9c364f73402e4588eb07a2bc2f1773f"
            },
            "downloads": -1,
            "filename": "cosmology.api-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "0b11ecb6fa9cb3fccf8dde6c64691a4f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 49341,
            "upload_time": "2023-05-17T18:35:08",
            "upload_time_iso_8601": "2023-05-17T18:35:08.044988Z",
            "url": "https://files.pythonhosted.org/packages/2b/58/94ce26c3adfe91a4c33f95bfa2a66abed3f16f30c94d78db0a97f6ea970a/cosmology.api-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-17 18:35:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cosmology-api",
    "github_project": "cosmology.api",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "cosmology.api"
}
        
Elapsed time: 0.06982s