Giter VIP home page Giter VIP logo

for-a-few-dpps-more / structure-factor Goto Github PK

View Code? Open in Web Editor NEW
9.0 3.0 5.0 115.91 MB

Compute structure factor of stationary and isotropic point processes

Home Page: https://for-a-few-dpps-more.github.io/structure-factor/

License: MIT License

Python 84.19% Jupyter Notebook 15.81%
python-package spatial-statistics hyperuniformity structure-factor point-processes stochastic-geometry

structure-factor's Introduction

structure-factor

CI-tests codecov docs-build docs-page PyPi version Python >=3.7.1,<3.10

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

Introduction

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

  • various estimators of the structure factor
  • several diagnostics of hyperuniformity

for stationary and isotropic point processes.

Please checkout the documentation for more details.

Dependencies

Installation

structure-factor works with Python >=3.7.1,<3.10.

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
    # poetry add structure-factor@latest to update if already present
    # pip install --upgrade 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
    # activate a virtual environment
    pip install '.[notebook]'  # (see [tool.poetry.extras] in pyproject.toml)
    sphinx-build -b html docs docs/_build/html
    open _build/html/index.html

Getting started

Documentation

See the documentation docs-page

Notebooks

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

How to cite this work

Companion paper

We wrote a companion paper to structure-factor,

On estimating the structure factor of a point process, with applications to hyperuniformity

where we provided rigorous mathematical derivations of the structure factor's estimators of a stationary point process and showcased structure-factor on different point processes. We also contribute a new asymptotically valid statistical test of hyperuniformity. Finally, we compared numerically the accuracy of the estimators.

Citation

If structure-factor has been significant in your research, and you would like to acknowledge the project in your academic publication, please consider citing it with this piece of BibTeX:

@article{HGBLR:22,
  journal = {Statistics and Computing},
  author  = {Hawat, Diala and Gautier, Guillaume and Bardenet, R{\'{e}}mi and Lachi{\`{e}}ze-Rey, Rapha{\"{e}}l},
  number  = {33},
  volume  = {61},
  title   = {On estimating the structure factor of a point process, with applications to hyperuniformity},
  year    = {2023},
}

structure-factor's People

Contributors

dhawat avatar guilgautier avatar rbardenet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

structure-factor's Issues

[Good practice] format code before push

It would be great to use an automatic code formating tool to standardize and clean code before pushing
Most IDEs and text editors already include this feature, let's use it

  • indentation
  • trailing whitespaces
  • spacing between function/class declarations
  • spacing
  • orthograph/grammar
  • ...

Make sure error bars are on the mean

I have the impression that current error bars on 1D plots of S(k) are computed as the std of the values of S falling in each bin. But we are rather interested in the standard deviation of the empirical mean, which is the same value but divided by the sqrt of the number of points that fall in each bin. A quick sanity check is that the error bar in a bin should get smaller as the number of points in that bin increases.

Start structuring the package

Let's organize files according to Python standards.

More generally, I suggest we use poetry as a tool to manage dependencies and in a near future to release the package on PyPI. I'll show you how to work with it ;)

cut plots or (better) plot the boundary of the observation window

When calling pp.plot(), there is a lot of whitespace around the observation window. To make sure that the user understands that this white space is there because it is outside of the observation window, and not because by chance no points fell there, I would plot the boundary of the observation window.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.