ampycloud 0.6.0.dev0__tar.gz → 2.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/AUTHORS +1 -0
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/CHANGELOG +27 -3
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/CONTRIBUTING.md +15 -13
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/PKG-INFO +10 -6
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/README.md +2 -1
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/setup.py +10 -6
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud/cluster.py +3 -3
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud/core.py +33 -15
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud/data.py +442 -202
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud/fluffer.py +11 -7
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud/hardcoded.py +2 -2
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud/icao.py +1 -1
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud/layer.py +36 -12
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud/plots/core.py +6 -3
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud/plots/diagnostics.py +170 -167
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud/plots/secondary.py +8 -8
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud/plots/tools.py +2 -2
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud/prms/ampycloud_default_prms.yml +28 -29
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud/scaler.py +13 -13
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud/utils/mocker.py +59 -50
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud/utils/performance.py +0 -2
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud/utils/utils.py +80 -22
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud/version.py +1 -1
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud/wmo.py +6 -6
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud.egg-info/PKG-INFO +10 -6
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud.egg-info/requires.txt +2 -0
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/CODE_OF_CONDUCT.md +0 -0
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/LICENSE +0 -0
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/MANIFEST.in +0 -0
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/setup.cfg +0 -0
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud/__init__.py +0 -0
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud/__main__.py +0 -0
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud/dynamic.py +0 -0
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud/errors.py +0 -0
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud/logger.py +0 -0
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud/plots/__init__.py +0 -0
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud/plots/hardcoded.py +0 -0
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud/plots/mpl_styles/base.mplstyle +0 -0
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud/plots/mpl_styles/latex.mplstyle +0 -0
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud/plots/mpl_styles/metsymb.mplstyle +0 -0
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud/utils/__init__.py +0 -0
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud.egg-info/SOURCES.txt +0 -0
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud.egg-info/dependency_links.txt +0 -0
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud.egg-info/entry_points.txt +0 -0
- {ampycloud-0.6.0.dev0 → ampycloud-2.0.0}/src/ampycloud.egg-info/top_level.txt +0 -0
|
@@ -3,6 +3,33 @@ All notable changes to ampycloud will be documented in this file.
|
|
|
3
3
|
The format is inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
5
5
|
|
|
6
|
+
## [v2.0.0]
|
|
7
|
+
### Added:
|
|
8
|
+
- [fpavogt, 2024-06-26] Add ability to trigger weekly tests manually.
|
|
9
|
+
- [fpavogt, 2024-04-16] Improve input data consistency check (fix #116).
|
|
10
|
+
- [regDaniel, 2024-04-09] Add flag for clouds above (MSA + MSA_HIT_BUFFER) and allow for NSC in METAR message.
|
|
11
|
+
- [fpavogt, 2024-03-26] Add option to reset only a single parameter.
|
|
12
|
+
### Fixed:
|
|
13
|
+
- [srethore, 2024-04-23] Fix static types issues.
|
|
14
|
+
- [regDaniel, 2024-04-23] Fix deprecated github actions worklflow file
|
|
15
|
+
- [fpavogt, 2024-04-17] Fix #119
|
|
16
|
+
- [regDaniel, 2024-04-09] Minor adaptions to better comply with PEP standards.
|
|
17
|
+
- [fpavogt, 2024-03-26] Use "height" in "ft aal" throughout.
|
|
18
|
+
### Changed:
|
|
19
|
+
- [fpavogt, 2024-06-25] Add support for numpy >2.0
|
|
20
|
+
- [fpavogt, 2024-04-28] Add a rogue point to the mock example.
|
|
21
|
+
- [fpavogt, 2024-03-25] Set the fluffiness boost to 2 (fixes #123).
|
|
22
|
+
- [fpavogt, 2024-03-23] Changed default mock dataset to be 900s long (instead of 2400s).
|
|
23
|
+
|
|
24
|
+
## [v1.0.0]
|
|
25
|
+
### Added:
|
|
26
|
+
- [regDaniel, 2023-11-09] Add minimum separation condition for grouping step.
|
|
27
|
+
### Fixed:
|
|
28
|
+
- [regDaniel, 2023-11-09] Fix #107 (no more reporting of two layers at same height).
|
|
29
|
+
### Changed:
|
|
30
|
+
- [fpavogt, 2023-11-05] Updated version to 1.0.0 for first full release, incl. misc documentation changes.
|
|
31
|
+
- [regDaniel, 2023-11-09] Changed min sep in layering from layer mean to layer base altitude.
|
|
32
|
+
- [regDaniel, 2023-11-10] Refactoring (modularization) of metarize method.
|
|
6
33
|
|
|
7
34
|
## [v0.6.0.dev0]
|
|
8
35
|
### Added:
|
|
@@ -27,9 +54,6 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|
|
27
54
|
- [fpavogt, 2022-10-18] Cleanup pylint and error messages.
|
|
28
55
|
- [fpavogt, 2022-10-18] Use min/max+padding to assess if slices are overlapping, instead of mean+std.
|
|
29
56
|
- [fpavogt, 2022-10-18] Default value of OKTA_LIM8 is changed from 98 to 99.
|
|
30
|
-
### Deprecated:
|
|
31
|
-
### Removed:
|
|
32
|
-
### Security:
|
|
33
57
|
|
|
34
58
|
## [v0.5.0.dev0]
|
|
35
59
|
### Fixed:
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
If you:
|
|
4
4
|
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* :construction_worker: want to **contribute** to ampycloud
|
|
5
|
+
* :boom: want to **report a bug** with ampycloud: [jump here.](https://github.com/MeteoSwiss/ampycloud/issues)
|
|
6
|
+
* :question: have a **question** about ampycloud: [jump here instead.](https://github.com/MeteoSwiss/ampycloud/discussions)
|
|
7
|
+
* :construction_worker: want to **contribute** to ampycloud, read on !
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
## Table of contents
|
|
11
11
|
|
|
12
12
|
- [Code of conduct](#code-of-conduct)
|
|
13
|
-
- [Scope
|
|
13
|
+
- [Scope](#scope)
|
|
14
14
|
- [Essential things to know about ampycloud for dev work](#essential-things-to-know-about-ampycloud-for-dev-work)
|
|
15
15
|
- [Branching model](#branching-model)
|
|
16
16
|
- [Installing from source](#installing-from-source)
|
|
@@ -23,7 +23,7 @@ If you:
|
|
|
23
23
|
- [Documentation](#documentation)
|
|
24
24
|
- [Testing](#testing)
|
|
25
25
|
- [Plotting](#plotting)
|
|
26
|
-
- [Release
|
|
26
|
+
- [Release mechanism](#release-mechanism)
|
|
27
27
|
- [Less-Essential things to know about ampycloud for dev work](#less-essential-things-to-know-about-ampycloud-for-dev-work)
|
|
28
28
|
- [Updating the copyright years](#updating-the-copyright-years)
|
|
29
29
|
|
|
@@ -31,10 +31,9 @@ If you:
|
|
|
31
31
|
## Code of conduct
|
|
32
32
|
|
|
33
33
|
This project and everyone participating in it is governed by the [ampycloud Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
|
|
34
|
-
Please report unacceptable behavior to [loris.foresti@meteoswiss.ch](mailto:loris.foresti@meteoswiss.ch)
|
|
34
|
+
Please report unacceptable behavior to [loris.foresti@meteoswiss.ch](mailto:loris.foresti@meteoswiss.ch).
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
## Scope of ampycloud
|
|
36
|
+
## Scope
|
|
38
37
|
|
|
39
38
|
Please be sure to read (and understand the implications) of the
|
|
40
39
|
[scope of ampycloud](https://meteoswiss.github.io/ampycloud/index.html#scope-of-ampycloud).
|
|
@@ -86,9 +85,11 @@ Automated CI/CD checks are triggered upon Pull Requests being issued towards the
|
|
|
86
85
|
* automatic publication of the Sphinx docs (for a PR to `master` only)
|
|
87
86
|
* check that the code version was incremented (for PR to `master` only)
|
|
88
87
|
|
|
89
|
-
To test the code with the latest Python developments, a `pytest-
|
|
88
|
+
To test the latest release of the code with the latest Python developments, a `pytest-weekly` workflow runs the
|
|
90
89
|
ampycloud tests twice a week using the latest version of Python and of the ampycloud dependencies.
|
|
91
90
|
|
|
91
|
+
:warning: This test is being run from the `master` branch. Pushing a bug fix to `develop` will not be sufficient to make it turn green - a new code release is necessary !
|
|
92
|
+
|
|
92
93
|
There is another Github action responsible for publishing the code onto pypi, that gets triggered
|
|
93
94
|
upon a new release or pre-release being published. See the ampycloud
|
|
94
95
|
[release mechanisms](#release-mechanisms) for details.
|
|
@@ -293,7 +294,7 @@ def some_plot_function(...):
|
|
|
293
294
|
With this decorator, all functions will automatically deploy the effects associated to the value of `dynamic.AMPYCLOUD_PRMS['MPL_STYLE']` which can take one of the following values:
|
|
294
295
|
`['base', 'latex', 'metsymb']`.
|
|
295
296
|
|
|
296
|
-
### Release
|
|
297
|
+
### Release mechanism
|
|
297
298
|
|
|
298
299
|
When changes merged in the `develop` branch are stable and deemed *worthy*, follow these steps to
|
|
299
300
|
create a new release of ampycloud:
|
|
@@ -325,13 +326,14 @@ create a new release of ampycloud:
|
|
|
325
326
|
- on the [release page](https://github.com/MeteoSwiss/ampycloud/releases),
|
|
326
327
|
- in the [README](https://github.com/MeteoSwiss/ampycloud/blob/develop/README.md) tags,
|
|
327
328
|
- on [testpypi](https://test.pypi.org/project/ampycloud/) and [pypi](https://pypi.org/project/ampycloud/),
|
|
328
|
-
- on the [`gh-pages` branch](https://github.com/MeteoSwiss/ampycloud/tree/gh-pages),
|
|
329
|
-
- in the [live documentation](https://MeteoSwiss.github.io/ampycloud)
|
|
329
|
+
- on the [`gh-pages` branch](https://github.com/MeteoSwiss/ampycloud/tree/gh-pages),
|
|
330
|
+
- in the [live documentation](https://MeteoSwiss.github.io/ampycloud), and
|
|
331
|
+
- on [Zenodo](https://zenodo.org/doi/10.5281/zenodo.8399683) (for which the connection to this repo is enabled from Zenodo itself, by the admins of the MeteoSwiss organization on Github).
|
|
330
332
|
|
|
331
333
|
## Less-Essential things to know about ampycloud for dev work
|
|
332
334
|
|
|
333
335
|
### Updating the copyright years
|
|
334
|
-
The ampycloud copyright years may need to be updated if the development goes on beyond 2022. If so,
|
|
336
|
+
The ampycloud copyright years may need to be updated if the development goes on beyond 2022 (which it already has 😉). If so,
|
|
335
337
|
the copyright years will need to be manually updated in the following locations:
|
|
336
338
|
|
|
337
339
|
* `docs/source/substitutions.rst` (the copyright tag)
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ampycloud
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: Determining the sky coverage fraction and base height of cloud layers usingceilometer data
|
|
5
5
|
Home-page: https://meteoswiss.github.io/ampycloud
|
|
6
|
-
Author: Frédéric P.A. Vogt
|
|
6
|
+
Author: Frédéric P.A. Vogt, Daniel Regenass
|
|
7
7
|
Author-email: frederic.vogt@meteoswiss.ch
|
|
8
8
|
License: BSD-3-Clause
|
|
9
9
|
Project-URL: Source, https://github.com/MeteoSwiss/ampycloud/
|
|
10
10
|
Project-URL: Changelog, https://meteoswiss.github.io/ampycloud/changelog.html
|
|
11
11
|
Project-URL: Issues, https://github.com/MeteoSwiss/ampycloud/issues
|
|
12
|
-
Classifier: Development Status ::
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
13
|
Classifier: Intended Audience :: Science/Research
|
|
14
14
|
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
|
|
15
15
|
Classifier: License :: OSI Approved :: BSD License
|
|
16
|
-
Classifier: Programming Language :: Python
|
|
16
|
+
Classifier: Programming Language :: Python
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
20
|
Requires-Python: >=3.9.0
|
|
18
21
|
Description-Content-Type: text/markdown
|
|
19
22
|
Provides-Extra: dev
|
|
@@ -22,6 +25,7 @@ License-File: AUTHORS
|
|
|
22
25
|
|
|
23
26
|
# ampycloud
|
|
24
27
|
|
|
28
|
+
[](https://zenodo.org/doi/10.5281/zenodo.8399683)
|
|
25
29
|
[](https://github.com/MeteoSwiss/ampycloud/releases)
|
|
26
30
|
[](https://github.com/MeteoSwiss/ampycloud)
|
|
27
31
|
[](https://github.com/MeteoSwiss/ampycloud/issues)
|
|
@@ -38,7 +42,7 @@ For the full documentation, installation instructions, etc ..., go to: https://m
|
|
|
38
42
|
|
|
39
43
|
### License & Copyright
|
|
40
44
|
|
|
41
|
-
ampycloud is released under the terms of **the 3-Clause BSD license**. The copyright (2021-
|
|
45
|
+
ampycloud is released under the terms of **the 3-Clause BSD license**. The copyright (2021-2024) belongs to MeteoSwiss.
|
|
42
46
|
|
|
43
47
|
### Contributing to ampycloud
|
|
44
48
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# ampycloud
|
|
2
2
|
|
|
3
|
+
[](https://zenodo.org/doi/10.5281/zenodo.8399683)
|
|
3
4
|
[](https://github.com/MeteoSwiss/ampycloud/releases)
|
|
4
5
|
[](https://github.com/MeteoSwiss/ampycloud)
|
|
5
6
|
[](https://github.com/MeteoSwiss/ampycloud/issues)
|
|
@@ -16,7 +17,7 @@ For the full documentation, installation instructions, etc ..., go to: https://m
|
|
|
16
17
|
|
|
17
18
|
### License & Copyright
|
|
18
19
|
|
|
19
|
-
ampycloud is released under the terms of **the 3-Clause BSD license**. The copyright (2021-
|
|
20
|
+
ampycloud is released under the terms of **the 3-Clause BSD license**. The copyright (2021-2024) belongs to MeteoSwiss.
|
|
20
21
|
|
|
21
22
|
### Contributing to ampycloud
|
|
22
23
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Copyright (c) 2021-
|
|
2
|
+
Copyright (c) 2021-2024 MeteoSwiss, contributors listed in AUTHORS.
|
|
3
3
|
|
|
4
4
|
Distributed under the terms of the 3-Clause BSD License.
|
|
5
5
|
|
|
@@ -35,9 +35,10 @@ setup(
|
|
|
35
35
|
'Changelog': 'https://meteoswiss.github.io/ampycloud/changelog.html',
|
|
36
36
|
'Issues': 'https://github.com/MeteoSwiss/ampycloud/issues'
|
|
37
37
|
},
|
|
38
|
-
author="Frédéric P.A. Vogt",
|
|
38
|
+
author="Frédéric P.A. Vogt, Daniel Regenass",
|
|
39
39
|
author_email="frederic.vogt@meteoswiss.ch",
|
|
40
|
-
description="
|
|
40
|
+
description="Determining the sky coverage fraction and base height of cloud layers using"
|
|
41
|
+
"ceilometer data",
|
|
41
42
|
long_description=long_description,
|
|
42
43
|
long_description_content_type="text/markdown",
|
|
43
44
|
python_requires='>=3.9.0',
|
|
@@ -52,7 +53,7 @@ setup(
|
|
|
52
53
|
"ruamel.yaml"
|
|
53
54
|
],
|
|
54
55
|
extras_require={
|
|
55
|
-
'dev': ['sphinx', 'sphinx-rtd-theme', 'pylint', 'pytest']
|
|
56
|
+
'dev': ['sphinx', 'sphinx-rtd-theme', 'pylint', 'pytest', 'setuptools', 'mypy']
|
|
56
57
|
},
|
|
57
58
|
# Setup entry points to use ampycloud directly from a terminal
|
|
58
59
|
entry_points={
|
|
@@ -63,7 +64,7 @@ setup(
|
|
|
63
64
|
# 3 - Alpha
|
|
64
65
|
# 4 - Beta
|
|
65
66
|
# 5 - Production/Stable
|
|
66
|
-
'Development Status ::
|
|
67
|
+
'Development Status :: 5 - Production/Stable',
|
|
67
68
|
# Indicate who your project is intended for
|
|
68
69
|
'Intended Audience :: Science/Research',
|
|
69
70
|
'Topic :: Scientific/Engineering :: Atmospheric Science',
|
|
@@ -71,7 +72,10 @@ setup(
|
|
|
71
72
|
'License :: OSI Approved :: BSD License',
|
|
72
73
|
# Specify the Python versions you support here. In particular, ensure
|
|
73
74
|
# that you indicate whether you support Python 2, Python 3 or both.
|
|
74
|
-
'Programming Language :: Python
|
|
75
|
+
'Programming Language :: Python',
|
|
76
|
+
'Programming Language :: Python :: 3.9',
|
|
77
|
+
'Programming Language :: Python :: 3.10',
|
|
78
|
+
'Programming Language :: Python :: 3.11',
|
|
75
79
|
],
|
|
76
80
|
# Let's make sure the parameter non-py files get included in the wheels on pypi.
|
|
77
81
|
include_package_data=True
|
|
@@ -10,7 +10,7 @@ Module contains: clustering tools
|
|
|
10
10
|
|
|
11
11
|
# Import from Python
|
|
12
12
|
import logging
|
|
13
|
-
from typing import Union
|
|
13
|
+
from typing import Optional, Union
|
|
14
14
|
import numpy as np
|
|
15
15
|
from sklearn.cluster import AgglomerativeClustering
|
|
16
16
|
|
|
@@ -23,7 +23,7 @@ logger = logging.getLogger(__name__)
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
@log_func_call(logger)
|
|
26
|
-
def agglomerative_cluster(data: np.ndarray, n_clusters: int = None,
|
|
26
|
+
def agglomerative_cluster(data: np.ndarray, n_clusters: Union[int, None] = None,
|
|
27
27
|
metric: str = 'euclidean', linkage: str = 'single',
|
|
28
28
|
distance_threshold: Union[int, float] = 1) -> tuple:
|
|
29
29
|
""" Function that wraps arround :py:class:`sklearn.cluster.AgglomerativeClustering`.
|
|
@@ -54,7 +54,7 @@ def agglomerative_cluster(data: np.ndarray, n_clusters: int = None,
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
@log_func_call(logger)
|
|
57
|
-
def clusterize(data: np.ndarray, algo: str = None, **kwargs: dict) -> tuple:
|
|
57
|
+
def clusterize(data: np.ndarray, algo: Union[str, None] = None, **kwargs: dict) -> Optional[tuple]:
|
|
58
58
|
""" Umbrella clustering routine, that provides a single access point to the different clustering
|
|
59
59
|
algorithms.
|
|
60
60
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Copyright (c) 2021-
|
|
2
|
+
Copyright (c) 2021-2024 MeteoSwiss, contributors listed in AUTHORS.
|
|
3
3
|
|
|
4
4
|
Distributed under the terms of the BSD-3-Clause license.
|
|
5
5
|
|
|
@@ -56,11 +56,11 @@ def copy_prm_file(save_loc: str = './', which: str = 'defaults') -> None:
|
|
|
56
56
|
"""
|
|
57
57
|
|
|
58
58
|
# Let's take a look at the path I was given
|
|
59
|
-
|
|
59
|
+
given_path = Path(save_loc)
|
|
60
60
|
# I won't create stuff for the users. ampycloud is not that nice.
|
|
61
|
-
if not
|
|
61
|
+
if not given_path.exists():
|
|
62
62
|
raise AmpycloudError('save_loc does not appear to exist !')
|
|
63
|
-
if not
|
|
63
|
+
if not given_path.is_dir():
|
|
64
64
|
raise AmpycloudError('save_loc does not appear to be a directory !')
|
|
65
65
|
|
|
66
66
|
# Next, let's look at all the parameter files available ...
|
|
@@ -73,11 +73,11 @@ def copy_prm_file(save_loc: str = './', which: str = 'defaults') -> None:
|
|
|
73
73
|
if (fname := f'ampycloud_{which}_prms.yml') not in ref_files:
|
|
74
74
|
raise AmpycloudError(f'Parameter file {fname} not found.')
|
|
75
75
|
|
|
76
|
-
if (
|
|
77
|
-
raise AmpycloudError(f'File {fname} already exists at save_loc={
|
|
76
|
+
if (given_path / fname).exists():
|
|
77
|
+
raise AmpycloudError(f'File {fname} already exists at save_loc={given_path}')
|
|
78
78
|
|
|
79
79
|
# All looks good, let's copy the file
|
|
80
|
-
copy(ref_loc / fname,
|
|
80
|
+
copy(ref_loc / fname, given_path / fname)
|
|
81
81
|
|
|
82
82
|
|
|
83
83
|
@log_func_call(logger)
|
|
@@ -131,9 +131,13 @@ def set_prms(pth: Union[str, Path]) -> None:
|
|
|
131
131
|
|
|
132
132
|
|
|
133
133
|
@log_func_call(logger)
|
|
134
|
-
def reset_prms() -> None:
|
|
134
|
+
def reset_prms(which: Union[str, list, None] = None) -> None:
|
|
135
135
|
""" Reset the ampycloud dynamic=scientific parameters to their default values.
|
|
136
136
|
|
|
137
|
+
Args:
|
|
138
|
+
which (str|list, optional): (list of) names of parameters to reset specifically.
|
|
139
|
+
If not set (by default), all parameters will be reset.
|
|
140
|
+
|
|
137
141
|
Example:
|
|
138
142
|
::
|
|
139
143
|
|
|
@@ -148,12 +152,26 @@ def reset_prms() -> None:
|
|
|
148
152
|
|
|
149
153
|
"""
|
|
150
154
|
|
|
151
|
-
|
|
155
|
+
if which is None:
|
|
156
|
+
dynamic.AMPYCLOUD_PRMS = dynamic.get_default_prms()
|
|
157
|
+
return
|
|
158
|
+
|
|
159
|
+
# Ok, reset the parameters one at a time
|
|
160
|
+
default_prms = dynamic.get_default_prms()
|
|
161
|
+
|
|
162
|
+
# Clean up which
|
|
163
|
+
which = [which] if isinstance(which, str) else which
|
|
164
|
+
|
|
165
|
+
for prm in which:
|
|
166
|
+
if prm not in default_prms.keys():
|
|
167
|
+
raise AmpycloudError(f'Unknown parameter name: {prm}')
|
|
168
|
+
|
|
169
|
+
dynamic.AMPYCLOUD_PRMS[prm] = default_prms[prm]
|
|
152
170
|
|
|
153
171
|
|
|
154
172
|
@log_func_call(logger)
|
|
155
|
-
def run(data: pd.DataFrame, prms: dict = None, geoloc: str = None,
|
|
156
|
-
ref_dt: Union[str, datetime] = None) -> CeiloChunk:
|
|
173
|
+
def run(data: pd.DataFrame, prms: Union[dict, None] = None, geoloc: Union[str, None] = None,
|
|
174
|
+
ref_dt: Union[str, datetime, None] = None) -> CeiloChunk:
|
|
157
175
|
""" Runs the ampycloud algorithm on a given dataset.
|
|
158
176
|
|
|
159
177
|
Args:
|
|
@@ -179,7 +197,7 @@ def run(data: pd.DataFrame, prms: dict = None, geoloc: str = None,
|
|
|
179
197
|
|
|
180
198
|
.. important ::
|
|
181
199
|
ampycloud treats Vertical Visibility hits no differently than any other hit. Hence, it is up
|
|
182
|
-
to the user to adjust the Vertical Visibility hit
|
|
200
|
+
to the user to adjust the Vertical Visibility hit height (and/or ignore some of them, for
|
|
183
201
|
example) prior to feeding them to ampycloud, so that it can be used as a cloud hit.
|
|
184
202
|
|
|
185
203
|
.. important::
|
|
@@ -193,7 +211,7 @@ def run(data: pd.DataFrame, prms: dict = None, geoloc: str = None,
|
|
|
193
211
|
|
|
194
212
|
All the scientific parameters of the algorithm are set dynamically in the :py:mod:`.dynamic`
|
|
195
213
|
module. From within a Python session all these parameters can be changed directly. For example,
|
|
196
|
-
to change the Minimum Sector Altitude, one would do:
|
|
214
|
+
to change the Minimum Sector Altitude (to be specified in ft aal), one would do:
|
|
197
215
|
::
|
|
198
216
|
|
|
199
217
|
from ampycloud import dynamic
|
|
@@ -223,7 +241,7 @@ def run(data: pd.DataFrame, prms: dict = None, geoloc: str = None,
|
|
|
223
241
|
The :py:class:`.data.CeiloChunk` instance returned by this function contains all the information
|
|
224
242
|
associated to the ampycloud algorithm, inclduing the raw data and slicing/grouping/layering
|
|
225
243
|
info. Its method :py:meth:`.data.CeiloChunk.metar_msg` provides direct access to the resulting
|
|
226
|
-
METAR-like message. Users that require the
|
|
244
|
+
METAR-like message. Users that require the height, okta amount, and/or exact sky coverage
|
|
227
245
|
fraction of layers can get them via the :py:attr:`.data.CeiloChunk.layers` class property.
|
|
228
246
|
|
|
229
247
|
Example:
|
|
@@ -239,7 +257,7 @@ def run(data: pd.DataFrame, prms: dict = None, geoloc: str = None,
|
|
|
239
257
|
# Generate the canonical demo dataset for ampycloud
|
|
240
258
|
mock_data = mocker.canonical_demo_data()
|
|
241
259
|
|
|
242
|
-
# Run the ampycloud algorithm on it, setting the MSA to 10'000 ft
|
|
260
|
+
# Run the ampycloud algorithm on it, setting the MSA to 10'000 ft aal.
|
|
243
261
|
chunk = ampycloud.run(mock_data, prms={'MSA':10000},
|
|
244
262
|
geoloc='Mock data', ref_dt=datetime.now())
|
|
245
263
|
|