Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Particle Representation Factory #12

Merged
merged 32 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
53e1598
rep factory
Gorkowski Jun 3, 2024
fd04b3e
update factories
Gorkowski Jun 3, 2024
424b4ef
update factory
Gorkowski Jun 3, 2024
8f74209
update
Gorkowski Jun 3, 2024
736cde5
download button test2
Gorkowski Jun 3, 2024
260eb7f
added lognormal
Gorkowski Jun 4, 2024
616ceb8
update text
Gorkowski Jun 4, 2024
f77cb6a
added pms pdf tutorial
Gorkowski Jun 4, 2024
4d5d12e
outline index
Gorkowski Jun 4, 2024
9629b2b
update headers
Gorkowski Jun 4, 2024
6dc31d2
break
Gorkowski Jun 4, 2024
fe68a9b
strat docs update
Gorkowski Jun 4, 2024
1534540
builder and fac doc activity revised
Gorkowski Jun 4, 2024
2a6cf90
revised doc space
Gorkowski Jun 4, 2024
502de2a
kappa doc update
Gorkowski Jun 4, 2024
e7e7a2b
space update
Gorkowski Jun 4, 2024
ed27a3f
last update
Gorkowski Jun 4, 2024
d19d443
added guides ref
Gorkowski Jun 4, 2024
2896b06
removed array auto builder for to abstract
Gorkowski Jun 4, 2024
dbc58f6
added builder defaults
Gorkowski Jun 4, 2024
f7fd97f
update units
Gorkowski Jun 4, 2024
33546ef
particle rep test
Gorkowski Jun 4, 2024
e9c56db
update spacing
Gorkowski Jun 4, 2024
5c0bc87
update description
Gorkowski Jun 4, 2024
7a19179
eod
Gorkowski Jun 4, 2024
5cfd38f
removed nav footer
Gorkowski Jun 5, 2024
6750354
test for particle rep factory and reorg defaults in build
Gorkowski Jun 5, 2024
1640ba3
update lint
Gorkowski Jun 5, 2024
15ee14b
added code block
Gorkowski Jun 5, 2024
a065323
std explained
Gorkowski Jun 5, 2024
3828433
update stream docs
Gorkowski Jun 5, 2024
a3e2c24
update enumerate dict
Gorkowski Jun 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/next/DocsImageDevGuide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
339 changes: 339 additions & 0 deletions docs/next/Tutorials/Aerosol_Distributions.ipynb

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions docs/next/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Next Outline

Next is the next iteration of the particula simulation model. It is a complete rewrite of the model, with a focus on improving the modularity and extensibility of the model. The goal is to make it easier to add new features and to make the model more flexible and easier to use.

## Tutorials

- [Aerosol Distribution](Tutorials/Aerosol_Distributions.ipynb)
- [Vapor Pressure](Tutorials/next_vapor_pressure.ipynb)

## Guides for Developers

![Four Quadrant representation of Tutorials, How to guides, References, and Discussions Areas](DocsImageDevGuide.png)
9 changes: 4 additions & 5 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ theme:
- navigation.sections
- navigation.tracking
- navigation.top
- navigation.footer
# - navigation.footer
- toc.integrate
- header.autohide
- search.suggest
Expand Down Expand Up @@ -87,11 +87,10 @@ markdown_extensions:

plugins:
- search
# - social
- mkdocs-jupyter:
include_source: True
execute: False # takes too long, should build separately
allow_errors: True
include_source: True # This enables the download of notebook sources.
execute: False # Avoid executing notebooks during the build.
allow_errors: True # Allow errors in the notebooks.

extra_css:
- stylesheets/extra.css
Expand Down
1 change: 0 additions & 1 deletion particula/data/lake.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ def add_stream(self, stream: Stream, name: str) -> None:
"""Add a stream to the lake.

Args:
-----------
stream (Stream): The stream object to be added.
name (str): The name of the stream.

Expand Down
42 changes: 33 additions & 9 deletions particula/data/lake_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,48 @@

from typing import Optional, Union
import numpy as np
from numpy.typing import NDArray

from particula.data.lake import Lake
from particula.data import stream_stats


def average_std(
lake: Lake,
average_interval: Union[float, int] = 60,
new_time_array: Optional[np.ndarray] = None,
clone: bool = True,
lake: Lake,
average_interval: Union[float, int] = 60,
new_time_array: Optional[NDArray[np.float_]] = None,
clone: bool = True,
) -> Lake:
""""
Averages the data in a lake over a specified time interval.
"""Averages the data in each stream within a 'Lake' object.

If 'clone' is True, a new 'Lake' instance is created and the averaged
data is stored there. If 'clone' is False, the original 'Lake' instance
is modified. The averaged output also includes the standard deviation of
the data.

Example:
```python
# Example lake with two streams, each containing numerical data
lake_data = Lake({'stream1': [1, 2, 3], 'stream2': [4, 5, 6]})
# Average over a 60-second interval without creating a new lake.
averaged_lake = average_std(lake_data, 60, clone=False)
print(averaged_lake)
Lake({'stream1': [2], 'stream2': [5]})
```

Args:
lake: The lake data structure containing multiple streams.
average_interval: The interval over which to average the data.
Default is 60.
new_time_array: A new array of time points at which to compute the
averages.
clone: Indicates whether to modify the original lake or return a new
one. Default is True.

Returns:
Lake: A lake instance with averaged data.
"""
# nice line of code
lake_averaged = Lake() if clone else lake

# iterate over streams in lake
for name, stream in lake.items():
lake_averaged[name] = stream_stats.average_std(
stream=stream,
Expand Down
Loading
Loading