snowfake

Fake snow flakes: snowfakes!

https://github.com/agilescientific/snowfake

Science Score: 57.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.7%) to scientific vocabulary
Last synced: 7 months ago · JSON representation ·

Repository

Fake snow flakes: snowfakes!

Basic Info
Statistics
  • Stars: 7
  • Watchers: 2
  • Forks: 3
  • Open Issues: 8
  • Releases: 4
Created over 4 years ago · Last pushed over 3 years ago
Metadata Files
Readme Contributing License Citation Authors

README.md

snowfake

Run tests Build docs PyPI version PyPI versions PyPI license

Make Gravner-Griffeath "snowfakes"! This code implements:

Janko Gravner, David Griffeath (2008). Modeling snow crystal growth II: A mesoscopic lattice map with plausible dynamics. Physica D: Nonlinear Phenomena 237 (3), p 385-404. DOI: 10.1016/j.physd.2007.09.008.

Snowfakes

Installation

You can install this package with pip (be careful not to type "snowflake"):

pip install snowfake

Installing scikit-image allows you to use a different affine transformation, but I haven't figured out yet if it's better or not.

pip install snowfake[skimage]

Documentation

Read the documentation

Example

You can produce a random snowfake with:

python import snowfake s = snowfake.random()

Alternatively, this code produces the crystal in Figure 5b of the Gravner & Griffeath (2008):

```python from snowfake import Snowfake

params = { 'ρ': 0.35, # or 'rho': 0.35 if you prefer... 'β': 1.4, 'α': 0.001, 'θ': 0.015, 'κ': 0.05, 'μ': 0.015, 'γ': 0.01, 'σ': 0.00005, 'random': False, } s = Snowfake(size=801, **params) ```

Now you're ready to grow and plot the snowfake:

python s.grow() s.plot()

The various physical parameter arrays are available as s.a (attachment flag), s.b (boundary mass), s.c (the crystal itself) and s.d (the vapour). The arrays exist on hexgrids; you can rectify them with, for example, s.rectify('c').

The parameter σ (note that you can also spell out sigma if you prefer) can be a 1D array with one sample per epoch. This will vary the vapour density ρ through time. The parameter ρ can be a 2D array of shape (size, size); this will vary the initial vapour density through space.

Testing

You can run the tests (requires pytest and pytest-cov) with

pytest

Building

This repo uses PEP 517-style packaging. Read more about this and about Python packaging in general.

Building the project requires build, so first:

pip install build

Then to build snowfake locally:

python -m build

The builds both .tar.gz and .whl files, either of which you can install with pip.

Continuous integration

This repo has two GitHub 'workflows' or 'actions':

  • Push to main: Run all tests on all version of Python. This is the Run tests workflow.
  • Publish a new release: Build and upload to PyPI. This is the Publish to PyPI workflow. Publish using the GitHub interface, for example (read more

Owner

  • Name: Agile*
  • Login: agilescientific
  • Kind: organization
  • Email: hello@agilescientific.com
  • Location: Canada

Agile was a scientific computing and consulting company in Canada, but it is now closed for business.

Citation (CITATION.cff)

cff-version: 1.2.0
title: snowfake
version: 0.1
message: Please use this information to cite this work.
type: software
authors:
  - given-names: Matt
    family-names: Hall
    email: matt@agilescientific.com
    affiliation: Agile Scientific
    orcid: 'https://orcid.org/0000-0002-4054-8295'
date-released: 2021-11-28

GitHub Events

Total
Last Year

Issues and Pull Requests

Last synced: 8 months ago

All Time
  • Total issues: 13
  • Total pull requests: 4
  • Average time to close issues: 22 days
  • Average time to close pull requests: 1 day
  • Total issue authors: 2
  • Total pull request authors: 2
  • Average comments per issue: 0.31
  • Average comments per pull request: 1.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • kwinkunks (12)
  • EvanBianco (1)
Pull Request Authors
  • mtb-za (2)
  • EvanBianco (2)
Top Labels
Issue Labels
enhancement (7) bug (4) documentation (1)
Pull Request Labels

Dependencies

.github/workflows/build-docs.yml actions
  • JamesIves/github-pages-deploy-action v4.2.3 composite
  • actions/checkout v1 composite
.github/workflows/publish-pypi.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • pypa/gh-action-pypi-publish 27b31702a0e7fc50959f5ad993c78deac1bdfc29 composite
.github/workflows/run-tests.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
pyproject.toml pypi
setup.py pypi