Skip to main content

No project description provided

Project description

structure-factor

CI-tests codecov docs-build docs-page Code style: black

Approximate the structure factor of a stationary point process, test its effective hyperuniformity, and identify its class of hyperuniformity.

Introduction

Hyperuniformity is the study of stationary point processes with a sub-Poisson variance of the number of points in a large window. To study the hyperuniformity of a given point process, a common practice in statistical physics is to estimate a spectral measure called the structure factor, the behavior of which around zero is a sign of hyperuniformity. The structure factor of a point process is defined via the Fourier transform of its total correlation function, and a point process is hyperuniform if its structure factor vanishes at zero. This Python toolbox gathers many estimators of the structure factor, along with a numerical test of effective hyperuniformity and a test for identifying the possible hyperuniformity class.


structure-factor is an open-source Python project which currently collects

Dependencies

  • R programming language, since we call the spatstat R package to estimate the pair correlation function of point processes using spatstat-interface.

  • Python dependencies are listed in the pyproject.toml file. Note that they mostly correspond to the latest version.

    [tool.poetry.dependencies]
    python = ">=3.8,<3.10"
    
    numpy = "^1.20.3"
    scipy = "^1.6.3"
    matplotlib = "^3.4.2"
    pandas = "^1.2.4"
    spatstat-interface = "^0.1.0"
    # spatstat-interface https://github.com/For-a-few-DPPs-more/spatstat-interface requires rpy2 https://rpy2.github.io/
    

Installation

structure-factor works with Python 3.8+.

Once installed it can be called from

  • import structure_factor
  • from structure_factor import ...

Install the project as a dependency

  • Install the latest version published on PyPi version

    # activate your virtual environment an run
    poetry add structure-factor
    # pip install structure-factor
    
  • Install from source (this may be broken)

    # activate your virtual environment and run
    poetry add git+https://github.com/For-a-few-DPPs-more/structure-factor.git
    # pip install git+https://github.com/For-a-few-DPPs-more/structure-factor.git
    

Install in editable mode and potentially contribute to the project

The package can be installed in editable mode using poetry.

To do this, clone the repository:

  • if you considered forking the repository

    git clone https://github.com/your_user_name/structure-factor.git
    
  • if you have not forked the repository

    git clone https://github.com/For-a-few-DPPs-more/structure-factor.git
    

and install the package in editable mode

cd structure-factor
poetry shell  # to create/activate local .venv (see poetry.toml)
poetry install
# poetry install --no-dev  # to avoid installing the development dependencies
# poetry add -E docs -E notebook  # to install extra dependencies

Documentation

The documentation docs-page is

Build the documentation

If you use poetry

  • install the documentation dependencies (see [tool.poetry.extras] in pyproject.toml)

    cd structure-factor
    poetry shell  # to create/activate local .venv (see poetry.toml)
    poetry install -E docs  # (see [tool.poetry.extras] in pyproject.toml)
    
  • and run

    # cd structure-factor
    # poetry shell  # to create/activate local .venv (see poetry.toml)
    poetry run sphinx-build -b html docs docs/_build/html
    open _build/html/index.html
    

Otherwise, if you don't use poetry

  • install the documentation dependencies (listed in [tool.poetry.extras] in pyproject.toml), and

  • run

    cd structure-factor
    sphinx-build -b html docs docs/_build/html
    open _build/html/index.html
    

Getting started

  • Jupyter notebooks that showcase structure-factor are available in the ./notebooks folder.

    • if you use poetry

      cd structure-factor
      poetry shell  # to create/activate local .venv (see poetry.toml)
      poetry install -E notebook  # (see [tool.poetry.extras] in pyproject.toml)
      # open a notebook within VSCode for example
      
  • See the documentation docs-page

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

structure-factor-1.0.0.tar.gz (3.0 MB view details)

Uploaded Source

Built Distribution

structure_factor-1.0.0-py3-none-any.whl (3.0 MB view details)

Uploaded Python 3

File details

Details for the file structure-factor-1.0.0.tar.gz.

File metadata

  • Download URL: structure-factor-1.0.0.tar.gz
  • Upload date:
  • Size: 3.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.8 CPython/3.9.2 Darwin/20.5.0

File hashes

Hashes for structure-factor-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b1d494527c675430f6c372380a1a49becb33fb023b0b9bc3b7dbaf1706789899
MD5 aeab415762594d9563ce8e297976b9eb
BLAKE2b-256 ebe0c27cc7414b6aee25730b6bfaf9839bf41053ac31ea945f2c7280661be614

See more details on using hashes here.

File details

Details for the file structure_factor-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for structure_factor-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e3f205ceb82197a728c96b516ec1a7ca55e83a5a5003cabfb407012bd38e2d9b
MD5 f9c89f9138983a840f25189d521c4a80
BLAKE2b-256 a934658df6039838b6a8d5a807b39a487cd0beda745642de55883459048e699d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page