sarabande


Namesarabande JSON
Version 1.1.2 PyPI version JSON
download
home_pagehttps://github.com/James11222/sarabande/
SummaryTool for measuring 3/4 PCFs on discrete periodic data.
upload_time2023-11-09 15:15:24
maintainer
docs_urlNone
authorJames Sunseri
requires_python>=3.6, <4
licenseMIT
keywords npcf 3pcf 4pcf cosmology hydrodynamics
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![codecov](https://codecov.io/gh/James11222/sarabande/branch/main/graph/badge.svg?token=47GPJCFZLE)](https://codecov.io/gh/James11222/sarabande) 
![PyPI](https://img.shields.io/pypi/v/sarabande?color=blue%20&label=PyPi%20)

<p align="center">
  <img src="logo/logo_text_dm.png#gh-dark-mode-only" width="100%">
  <img src="logo/logo_text.png#gh-light-mode-only" width="100%">
</p>

A useful `python` package to measure the 3/4 PCFs of discrete periodic data in NlogN time. This is done using Fast Fourier Transforms. 


## Installation: 
The package is available on PyPi via the command `pip install sarabande`. To check if the code is working properly after pip installation, run 

```python
import sarabande

sarabande.check_install()
```
which will display a message stating if the package was properly installed.

## Basic Usage:

```python
import sarabande

NPCF_obj = sarabande.measure(**kwargs)
sarabande.calc_zeta(NPCF_obj)
zeta = NPCF_obj.zeta
```

Where `**kwargs` can be any of the arguments to the measure constructor function. The possible arguments are:

`Args:`

* `nPCF` ([`int`]): Must be either 3 or 4. Determines how many points we use in our nPCF.
* `projected` ([`bool`]): Flag to determine whether the user wants a projected 3/4 PCF or the Full. Defaults to False.
    - if `projected`:
        - `m_max` ([`int`]): If user chooses projected, we set an m_max (similar to the `ell_max` in 3D)
    - if not `projected`:
        - `ell_max` ([`int`]): If user choosees not projected (full nPCF) then ell_max is the highest order for calculation.

* `density_field_data` ([`ndarray`]): A square ndarray of data that is periodic. Must be 2D for projected and 3D for full.
* `save_dir` ([`string`]): A string to tell the algorithm where to save and store files. All temporary files will be stored here.
* `save_name` ([`string`]): A string to tell the algorithm what to name the files.
* `nbins` ([`int`]): Number of bins to be used in nPCF calculation.
* `bin_spacing` ([`string`]): A string to determine the spacing of bins. Options are `'LIN'`, `'INV'`, or `'LOG'`
* `bin_min` ([`int`]): The lower bound of the inner most bin. Default is 1. Optional.
* `physical_boxsize` ([`float`]): An optional parameter if using a physical scale. The length of one side of the data.
* `rmin` ([`float`]): minimum calculation distance (determins `bin_min`)
* `rmax` ([`float`]): maximum calculation distance (determins `bin_max`)
* `normalize` ([`bool`]): A boolean flag to normalize the 3/4 PCFs. Defaults to True. Can't use normalize without giving a `physical_boxsize`, `rmin`, and `rmax` first.
* `particles_on_grid` ([`bool`]): An optional boolean flag to modify the normalization scheme slightly. This is recommended if you are working with particles on the grid mesh where a given cell corresponds to a particle. 

We note that the `calc_zeta` method has an optional boolean argument `verbose_flag` which can be turned on and off depending on if the user wants to see the steps of the code printed. We also add an optional boolean argument `parallelized` which can be turned on and off if the user wishes to compute the Full 4PCF serially. This is added due to the instability of `concurrent.futures` and parallel processing in python across different machines. 

We also provide an implementation of the connected 4PCF, this will be further documented in a future paper.

For an example, please visit the demo notebook in the analysis notebooks folder: `notebooks/Application_Example.ipynb`

 ## Workflow:    
The map of SARABANDE is as follows:

<p align="center">
  <img src="notebooks/paper_figures/workflow_dm.png#gh-dark-mode-only" width="100%">
  <img src="notebooks/paper_figures/workflow.png#gh-light-mode-only" width="100%">
</p>

For more information about each algorithm, please read [Sunseri et al. 2022](https://ui.adsabs.harvard.edu/abs/2022arXiv221010206S/abstract)

## Coverage [![codecov](https://codecov.io/gh/James11222/sarabande/branch/main/graph/badge.svg?token=47GPJCFZLE)](https://codecov.io/gh/James11222/sarabande) 
We provide a sunburst plot of the code coverage for sarabande below provided by codecov.io. The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.

<p align="center">
  <img src="https://codecov.io/gh/James11222/sarabande/branch/main/graphs/sunburst.svg?token=47GPJCFZLE">
</p>

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/James11222/sarabande/",
    "name": "sarabande",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6, <4",
    "maintainer_email": "",
    "keywords": "npcf,3pcf,4pcf,cosmology,hydrodynamics",
    "author": "James Sunseri",
    "author_email": "jamessunseri@berkeley.edu",
    "download_url": "https://files.pythonhosted.org/packages/fd/c3/ce2e356263fe3167206260dd1aa7e2940277dbe718631bc8b594b66fd718/sarabande-1.1.2.tar.gz",
    "platform": "any",
    "description": "[![codecov](https://codecov.io/gh/James11222/sarabande/branch/main/graph/badge.svg?token=47GPJCFZLE)](https://codecov.io/gh/James11222/sarabande) \n![PyPI](https://img.shields.io/pypi/v/sarabande?color=blue%20&label=PyPi%20)\n\n<p align=\"center\">\n  <img src=\"logo/logo_text_dm.png#gh-dark-mode-only\" width=\"100%\">\n  <img src=\"logo/logo_text.png#gh-light-mode-only\" width=\"100%\">\n</p>\n\nA useful `python` package to measure the 3/4 PCFs of discrete periodic data in NlogN time. This is done using Fast Fourier Transforms. \n\n\n## Installation: \nThe package is available on PyPi via the command `pip install sarabande`. To check if the code is working properly after pip installation, run \n\n```python\nimport sarabande\n\nsarabande.check_install()\n```\nwhich will display a message stating if the package was properly installed.\n\n## Basic Usage:\n\n```python\nimport sarabande\n\nNPCF_obj = sarabande.measure(**kwargs)\nsarabande.calc_zeta(NPCF_obj)\nzeta = NPCF_obj.zeta\n```\n\nWhere `**kwargs` can be any of the arguments to the measure constructor function. The possible arguments are:\n\n`Args:`\n\n* `nPCF` ([`int`]): Must be either 3 or 4. Determines how many points we use in our nPCF.\n* `projected` ([`bool`]): Flag to determine whether the user wants a projected 3/4 PCF or the Full. Defaults to False.\n    - if `projected`:\n        - `m_max` ([`int`]): If user chooses projected, we set an m_max (similar to the `ell_max` in 3D)\n    - if not `projected`:\n        - `ell_max` ([`int`]): If user choosees not projected (full nPCF) then ell_max is the highest order for calculation.\n\n* `density_field_data` ([`ndarray`]): A square ndarray of data that is periodic. Must be 2D for projected and 3D for full.\n* `save_dir` ([`string`]): A string to tell the algorithm where to save and store files. All temporary files will be stored here.\n* `save_name` ([`string`]): A string to tell the algorithm what to name the files.\n* `nbins` ([`int`]): Number of bins to be used in nPCF calculation.\n* `bin_spacing` ([`string`]): A string to determine the spacing of bins. Options are `'LIN'`, `'INV'`, or `'LOG'`\n* `bin_min` ([`int`]): The lower bound of the inner most bin. Default is 1. Optional.\n* `physical_boxsize` ([`float`]): An optional parameter if using a physical scale. The length of one side of the data.\n* `rmin` ([`float`]): minimum calculation distance (determins `bin_min`)\n* `rmax` ([`float`]): maximum calculation distance (determins `bin_max`)\n* `normalize` ([`bool`]): A boolean flag to normalize the 3/4 PCFs. Defaults to True. Can't use normalize without giving a `physical_boxsize`, `rmin`, and `rmax` first.\n* `particles_on_grid` ([`bool`]): An optional boolean flag to modify the normalization scheme slightly. This is recommended if you are working with particles on the grid mesh where a given cell corresponds to a particle. \n\nWe note that the `calc_zeta` method has an optional boolean argument `verbose_flag` which can be turned on and off depending on if the user wants to see the steps of the code printed. We also add an optional boolean argument `parallelized` which can be turned on and off if the user wishes to compute the Full 4PCF serially. This is added due to the instability of `concurrent.futures` and parallel processing in python across different machines. \n\nWe also provide an implementation of the connected 4PCF, this will be further documented in a future paper.\n\nFor an example, please visit the demo notebook in the analysis notebooks folder: `notebooks/Application_Example.ipynb`\n\n ## Workflow:    \nThe map of SARABANDE is as follows:\n\n<p align=\"center\">\n  <img src=\"notebooks/paper_figures/workflow_dm.png#gh-dark-mode-only\" width=\"100%\">\n  <img src=\"notebooks/paper_figures/workflow.png#gh-light-mode-only\" width=\"100%\">\n</p>\n\nFor more information about each algorithm, please read [Sunseri et al. 2022](https://ui.adsabs.harvard.edu/abs/2022arXiv221010206S/abstract)\n\n## Coverage [![codecov](https://codecov.io/gh/James11222/sarabande/branch/main/graph/badge.svg?token=47GPJCFZLE)](https://codecov.io/gh/James11222/sarabande) \nWe provide a sunburst plot of the code coverage for sarabande below provided by codecov.io. The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.\n\n<p align=\"center\">\n  <img src=\"https://codecov.io/gh/James11222/sarabande/branch/main/graphs/sunburst.svg?token=47GPJCFZLE\">\n</p>\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Tool for measuring 3/4 PCFs on discrete periodic data.",
    "version": "1.1.2",
    "project_urls": {
        "Bug Reports": "https://github.com/James11222/sarabande/issues",
        "Check out my Website!": "http://www.jamessunseri.com",
        "Funding": "https://donate.pypi.org",
        "Homepage": "https://github.com/James11222/sarabande/",
        "Source": "https://github.com/James11222/sarabande/"
    },
    "split_keywords": [
        "npcf",
        "3pcf",
        "4pcf",
        "cosmology",
        "hydrodynamics"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "14b6e25552dd007eaab02b8058a4c7f123d3b55f9ba0fbb7c18ecbb81d84cd25",
                "md5": "e8e236b4c73afa1bc97f5a6e85ac3483",
                "sha256": "f1c12c9414b2b307c95f1a12c19fbd56d4eca8f48bc096911ce401ebff4ffba2"
            },
            "downloads": -1,
            "filename": "sarabande-1.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e8e236b4c73afa1bc97f5a6e85ac3483",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6, <4",
            "size": 36786,
            "upload_time": "2023-11-09T15:15:22",
            "upload_time_iso_8601": "2023-11-09T15:15:22.141903Z",
            "url": "https://files.pythonhosted.org/packages/14/b6/e25552dd007eaab02b8058a4c7f123d3b55f9ba0fbb7c18ecbb81d84cd25/sarabande-1.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fdc3ce2e356263fe3167206260dd1aa7e2940277dbe718631bc8b594b66fd718",
                "md5": "6c300c26201dd753eb9582dc1ad14877",
                "sha256": "45f19ecde1bbb11034ed3b4369bf5129377955e540ec7b4878a40c7913acd77f"
            },
            "downloads": -1,
            "filename": "sarabande-1.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "6c300c26201dd753eb9582dc1ad14877",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6, <4",
            "size": 39742,
            "upload_time": "2023-11-09T15:15:24",
            "upload_time_iso_8601": "2023-11-09T15:15:24.056512Z",
            "url": "https://files.pythonhosted.org/packages/fd/c3/ce2e356263fe3167206260dd1aa7e2940277dbe718631bc8b594b66fd718/sarabande-1.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-09 15:15:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "James11222",
    "github_project": "sarabande",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "sarabande"
}
        
Elapsed time: 0.15455s