Skip to content

Commit

Permalink
Merge branch 'main' into issue_1449
Browse files Browse the repository at this point in the history
  • Loading branch information
AgnieszkaZaba authored Dec 17, 2024
2 parents 2fcd31d + 4f1f0fa commit bc174ac
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/projects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
issues:
types:
- opened
pull_request:
pull_request_target:
types:
- opened

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- run: |
echo pip_user_site=$(python -c "import sysconfig; print(sysconfig.get_path('purelib'))") >> $GITHUB_ENV
echo toml_ci_md5=$(cat pyproject.toml setup.py examples/pyproject.toml examples/setup.py tests/devops_tests/requirements.txt .github/workflows/tests+artifacts+pypi.yml \
echo toml_ci_md5=$(cat pyproject.toml setup.py examples/pyproject.toml examples/setup.py tests/devops_tests/requirements.txt .github/workflows/tests.yml \
| python -c "import hashlib;print(hashlib.md5(open(0,'rb').read()).hexdigest())") >> $GITHUB_ENV
- uses: actions/cache@v4
id: cache
Expand Down
11 changes: 6 additions & 5 deletions PySDM/products/size_spectral/size_standard_deviation.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,21 @@ def __init__(
ActivationFilteredProduct.__init__(
self, count_activated=count_activated, count_unactivated=count_unactivated
)
self.tmp = None

def register(self, builder):
builder.request_attribute(self.attr)
for base_class in (ActivationFilteredProduct, MomentProduct):
base_class.register(self, builder)
self.tmp = np.empty_like(self.buffer)

def _impl(self, **kwargs):
ActivationFilteredProduct.impl(self, attr=self.attr, rank=1)
tmp = np.empty_like(self.buffer)
tmp[:] = -self.buffer**2
self.tmp[:] = -self.buffer**2
ActivationFilteredProduct.impl(self, attr=self.attr, rank=2)
tmp[:] += self.buffer
tmp[:] = np.sqrt(tmp)
return tmp
self.tmp[:] += self.buffer
self.tmp[:] = np.sqrt(self.tmp)
return self.tmp


RadiusStandardDeviation = register_product()(_SizeStandardDeviation)
Expand Down
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# <img src="https://raw.githubusercontent.com/open-atmos/PySDM/main/.github/pysdm_logo.svg" width=100 height=146 alt="pysdm logo">
# <img src="https://raw.githubusercontent.com/open-atmos/PySDM/main/docs/logos/pysdm_logo.svg" width=100 height=146 alt="pysdm logo">

[![Python 3](https://img.shields.io/static/v1?label=Python&logo=Python&color=3776AB&message=3)](https://www.python.org/)
[![LLVM](https://img.shields.io/static/v1?label=LLVM&logo=LLVM&color=gold&message=Numba)](https://numba.pydata.org)
Expand All @@ -17,7 +17,7 @@

[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.html)

[![Github Actions Build Status](https://github.com/open-atmos/PySDM/workflows/tests+artifacts+pypi/badge.svg?branch=main)](https://github.com/open-atmos/PySDM/actions)
[![Github Actions Build Status](https://github.com/open-atmos/PySDM/workflows/tests/badge.svg?branch=main)](https://github.com/open-atmos/PySDM/actions)
[![Appveyor Build status](http://ci.appveyor.com/api/projects/status/github/open-atmos/PySDM?branch=main&svg=true)](https://ci.appveyor.com/project/slayoo/pysdm/branch/main)
[![Coverage Status](https://codecov.io/gh/open-atmos/PySDM/branch/main/graph/badge.svg)](https://app.codecov.io/gh/open-atmos/PySDM)
[![PyPI version](https://badge.fury.io/py/PySDM.svg)](https://pypi.org/project/PySDM)
Expand All @@ -35,6 +35,8 @@ The package features a Pythonic high-performance implementation of the
Super-Droplet Method (SDM) Monte-Carlo algorithm for representing collisional growth
([Shima et al. 2009](https://rmets.onlinelibrary.wiley.com/doi/abs/10.1002/qj.441)), hence the name.

PySDM documentation is maintained at: [https://open-atmos.github.io/PySDM](https://open-atmos.github.io/PySDM)

There is a growing set of [example Jupyter notebooks](https://open-atmos.github.io/PySDM/PySDM_examples.html) exemplifying how to perform
various types of calculations and simulations using PySDM.
Most of the example notebooks reproduce results and plot from literature, see below for
Expand Down Expand Up @@ -65,14 +67,6 @@ For an overview of PySDM features (and the preferred way to cite PySDM in papers
PySDM includes an extension of the SDM scheme to represent collisional breakup described in [de Jong, Mackay et al. 2023](10.5194/gmd-16-4193-2023).
For a list of talks and other materials on PySDM as well as a list of published papers featuring PySDM simulations, see the [project wiki](https://github.com/open-atmos/PySDM/wiki).

A [pdoc-generated](https://pdoc.dev/) documentation of PySDM public API is maintained at: [https://open-atmos.github.io/PySDM](https://open-atmos.github.io/PySDM)

## Example Jupyter notebooks (reproducing results from literature):

See [PySDM-examples README](https://github.com/open-atmos/PySDM/blob/main/examples/README.md).

![animation](https://github.com/open-atmos/PySDM/wiki/files/kinematic_2D_example.gif)

## Dependencies and Installation

PySDM dependencies are: [Numpy](https://numpy.org/), [Numba](http://numba.pydata.org/), [SciPy](https://scipy.org/),
Expand Down
File renamed without changes
2 changes: 1 addition & 1 deletion .github/pysdm_logo.svg → docs/logos/pysdm_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/markdown/pysdm_landing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Introduction

<img align="left" src="https://raw.githubusercontent.com/open-atmos/PySDM/main/.github/pysdm_logo.svg" width=150 height=219 alt="pysdm logo" style="padding-right:1em">
<img align="left" src="https://raw.githubusercontent.com/open-atmos/PySDM/main/docs/logos/pysdm_logo.svg" width=150 height=219 alt="pysdm logo" style="padding-right:1em">

PySDM offers a set of building blocks for development of atmospheric cloud
simulation systems revolving around the particle-based microphysics modelling concept
Expand Down
25 changes: 16 additions & 9 deletions docs/templates/index.html.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,32 @@
<main class="pdoc">
<div style="display: flex; align-items: center;">
<a href="https://open-atmos.github.io/PySDM/index.html">
<img src="https://raw.githubusercontent.com/open-atmos/PySDM/main/.github/pysdm_logo.svg" style="height:10em" alt="PySDM logo">
<img src="https://raw.githubusercontent.com/open-atmos/PySDM/main/docs/logos/pysdm_logo.svg" style="height:10em" alt="PySDM logo">
</a>
<h1 style="padding-left: 0.5em; color: #13A4DE; font-weight: normal ">Documentation</h1>
</div>
<div style="padding-top: 2em">
<h2>What is PySDM?</h2>
<p>
PySDM is a package for simulating the dynamics of population of particles.
It is intended to serve as a building block for simulation systems modelling fluid flows involving a dispersed phase, with PySDM being responsible for representation of the dispersed phase.
Currently, the development is focused on atmospheric cloud physics applications, in particular on modelling the dynamics of particles immersed in moist air using the particle-based (a.k.a. super-droplet) approach to represent aerosol/cloud/rain microphysics.
The package features a Pythonic high-performance implementation of the Super-Droplet Method (SDM) Monte-Carlo algorithm for representing collisional growth
(<a href="https://doi.org/10.1002/qj.441">Shima et al. 2009</a>), hence the name.
<video controls style="float:right; width:40%">
<source src="https://github.com/open-atmos/PySDM/wiki/files/animation_save.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
PySDM is a package for simulating the <mark>dynamics of population of particles undergoing diffusional and collisional growth (and breakage)</mark>.
The package features a Pythonic high-performance (multi-threaded CPU &amp; CUDA GPU) implementation of the <mark>Super-Droplet Method (SDM) Monte-Carlo algorithm</mark>
for representing collisional growth (<a href="https://doi.org/10.1002/qj.441">Shima et al. 2009</a>), hence the name.
It is intended to serve as a building block for simulation systems modelling <mark>fluid flows involving a dispersed phase</mark>,
with PySDM being responsible for representation of the dispersed phase.
Currently, the development is focused on atmospheric <mark>cloud physics applications</mark>, in particular on modelling the dynamics of
particles immersed in moist air using the particle-based (a.k.a. super-droplet) approach to represent aerosol/cloud/rain microphysics.
The key goal of PySDM is to enable rapid development and independent reproducibility of simulations in cloud microphysics
while being free from the two-language barrier commonly separating prototype and high-performance research code.
</p>
</div>
<div style="padding-top: 0.5em">
<h2>What is the difference between PySDM and PySDM-examples?</h2>
<p>
PySDM is a Python package that provides the implementation of the Super-Droplet Method (SDM) Monte-Carlo algorithm.
It is a library that can be used in your own projects.
PySDM is a Python package that provides the implementation of SDM that can be used in your own projects.
</p>
<p>
PySDM-examples is a Python package that provides examples of how to use PySDM.
Expand Down Expand Up @@ -159,7 +166,7 @@ jupyter-notebook PySDM/examples</code></pre>
</p>
<p>
Development of PySDM was supported by:
<ul>
<ul style="list-style:square; margin-left:1em;">
<li><a href="https://www.fnp.org.pl/en/">Foundation for Polish Science</a> (grant no. POIR.04.04.00-00-5E1C/18 co-financed by the European Union under the European Regional Development Fund)</li>
<li><a href="https://ncn.gov.pl/en">Polish National Science Centre</a> (grant no. 2020/39/D/ST10/01220)</li>
<li><a href="https://science.energy.gov">US Department of Energy</a> via the <a href="https://www.krellinst.org/csgf/">Computational Science Graduate Fellowship</a> and via the <a href="https://asr.science.energy.gov/">Atmospheric System Research Program</a> (grant no. DE-SC0021034)</li>
Expand Down
2 changes: 1 addition & 1 deletion examples/PySDM_examples/Berry_1967/example_fig_6.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def full_params(params):

def print_collection_efficiency_portrait(params):
size = 2 * 5.236
plt.figure(num=1, figsize=(size / 2, size))
plt.figure(figsize=(size / 2, size))
points = 200
Y_c = np.zeros(points)
x_values = np.linspace(0, 1, points)
Expand Down
2 changes: 1 addition & 1 deletion examples/PySDM_examples/Berry_1967/spectrum_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class SpectrumPlotter(SuperSpectrumPlotter):
def __init__(self, settings, title=None, grid=True, legend=False):
size = 2 * 5.236
pyplot.figure(num=1, figsize=(size, size * 0.54))
pyplot.figure(figsize=(size, size * 0.54))
pyplot.xlabel("particle radius [µm]")
pyplot.ylabel("dm/dlnr [g/m^3/(unit dr/r)]")
super().__init__(settings, title=title, grid=grid, legend=legend, log_base=2)
Expand Down
Loading

0 comments on commit bc174ac

Please sign in to comment.