pax_global_header00006660000000000000000000000064147420167210014516gustar00rootroot0000000000000052 comment=0261199dc02229fdf0b5b1239431177ecf728c56 datapoint-python-0.13.0/000077500000000000000000000000001474201672100151015ustar00rootroot00000000000000datapoint-python-0.13.0/.coveragerc000066400000000000000000000003521474201672100172220ustar00rootroot00000000000000[run] branch = True source = datapoint omit = datapoint/_version.py [report] exclude_lines = if self.debug pragma: no cover raise NotImplementedError if __name__ == .__main__.: ignore_errors = True omit = tests/* datapoint-python-0.13.0/.flake8000066400000000000000000000002141474201672100162510ustar00rootroot00000000000000[flake8] max-complexity = 10 max-line-length = 88 extend-select = B950 extend-ignore = E203,E501,E701 exclude = .git,__pycache__,build,dist datapoint-python-0.13.0/.gitattributes000066400000000000000000000000431474201672100177710ustar00rootroot00000000000000datapoint/_version.py export-subst datapoint-python-0.13.0/.github/000077500000000000000000000000001474201672100164415ustar00rootroot00000000000000datapoint-python-0.13.0/.github/dependabot.yml000066400000000000000000000002761474201672100212760ustar00rootroot00000000000000version: 2 updates: - package-ecosystem: pip directory: "/" schedule: interval: daily open-pull-requests-limit: 10 ignore: - dependency-name: pytz versions: - "2020.5" datapoint-python-0.13.0/.github/workflows/000077500000000000000000000000001474201672100204765ustar00rootroot00000000000000datapoint-python-0.13.0/.github/workflows/lint.yaml000066400000000000000000000021461474201672100223330ustar00rootroot00000000000000name: Lint on: pull_request: branches: - "master" jobs: black: runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v3 - name: Set up python uses: actions/setup-python@v4 with: python-version: "3.12" - name: Install and run linter run: | pip install black==22.10.0 black --check --verbose --diff --color -S . isort: runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v3 - name: Set up python uses: actions/setup-python@v4 with: python-version: "3.12" - name: Install and run linter run: | pip install isort==5.13.2 isort . --check-only --diff flake8: runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v3 - name: Set up python uses: actions/setup-python@v4 with: python-version: "3.12" - name: Install and run linter run: | pip install flake8==7.1.0 flake8-bugbear flake8-pytest-style flake8 datapoint-python-0.13.0/.github/workflows/publish-to-pypi.yml000066400000000000000000000023641474201672100242730ustar00rootroot00000000000000name: Publish Python 🐍 distribution 📦 to PyPI on: push jobs: build: name: Build distribution 📦 runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 fetch-tags: true - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.12" - name: Install hatch uses: pypa/hatch@install - name: Build a binary wheel and a source tarball run: hatch build - name: Store the distribution packages uses: actions/upload-artifact@v4 with: name: python-package-distributions path: dist/ publish-to-pypi: name: Publish Python 🐍 distribution 📦 to PyPI if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes needs: - build runs-on: ubuntu-latest environment: name: pypi url: https://pypi.org/p/datapoint permissions: id-token: write # IMPORTANT: mandatory for trusted publishing steps: - name: Download all the dists uses: actions/download-artifact@v4 with: name: python-package-distributions path: dist/ - name: Publish distribution 📦 to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 datapoint-python-0.13.0/.github/workflows/publish-to-test-pypi.yml000066400000000000000000000023701474201672100252450ustar00rootroot00000000000000name: Publish Python 🐍 distribution 📦 to TestPyPI on: push jobs: build: name: Build distribution 📦 runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 fetch-tags: true - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.12" - name: Install hatch uses: pypa/hatch@install - name: Build a binary wheel and a source tarball run: hatch build - name: Store the distribution packages uses: actions/upload-artifact@v4 with: name: python-package-distributions path: dist/ publish-to-testpypi: name: Publish Python 🐍 distribution 📦 to TestPyPI needs: - build runs-on: ubuntu-latest environment: name: testpypi url: https://test.pypi.org/p/datapoint permissions: id-token: write # IMPORTANT: mandatory for trusted publishing steps: - name: Download all the dists uses: actions/download-artifact@v4 with: name: python-package-distributions path: dist/ - name: Publish distribution 📦 to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: repository-url: https://test.pypi.org/legacy/ datapoint-python-0.13.0/.github/workflows/tests.yml000066400000000000000000000010521474201672100223610ustar00rootroot00000000000000name: Run tests on: pull_request jobs: run-tests: name: Run tests on python ${{ matrix.python-version }} runs-on: ubuntu-latest strategy: matrix: python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install requirements run: pip install -r requirements-dev.txt - name: Run tests run: python -m pytest tests datapoint-python-0.13.0/.gitignore000066400000000000000000000017421474201672100170750ustar00rootroot00000000000000## OS X .DS_Store .AppleDouble .LSOverride # Icon must end with two \r Icon # Thumbnails ._* # Files that might appear on external disk .Spotlight-V100 .Trashes # Directories potentially created on remote AFP share .AppleDB .AppleDesktop Network Trash Folder Temporary Items ## Python # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] # C extensions *.so # Distribution / packaging .Python env/ build/ develop-eggs/ dist/ eggs/ .eggs/ lib/ lib64/ parts/ sdist/ var/ *.egg-info/ .installed.cfg *.egg # PyInstaller # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest *.spec # Installer logs pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ .coverage .cache nosetests.xml coverage.xml # Translations *.mo *.pot # Django stuff: *.log # Sphinx documentation docs/_build/ # PyBuilder target/ # vi/vim *.swp # mkdocs site/ datapoint-python-0.13.0/.pre-commit-config.yaml000066400000000000000000000012521474201672100213620ustar00rootroot00000000000000# See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml - id: check-added-large-files - repo: https://github.com/pycqa/isort rev: 5.13.2 hooks: - id: isort - repo: https://github.com/pycqa/flake8 rev: 7.1.0 hooks: - id: flake8 additional_dependencies: - flake8-bugbear==24.2.6 - flake8-pytest-style==2.0.0 - repo: https://github.com/psf/black rev: 22.10.0 hooks: - id: black datapoint-python-0.13.0/.readthedocs.yaml000066400000000000000000000014741474201672100203360ustar00rootroot00000000000000# Read the Docs configuration file for Sphinx projects # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details # Required version: 2 # Set the OS, Python version and other tools you might need build: os: ubuntu-22.04 tools: python: "3.12" # Build documentation in the "docs/" directory with Sphinx sphinx: configuration: "docs/source/conf.py" # You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs # builder: "dirhtml" # Fail on all warnings to avoid broken references # fail_on_warning: true # Optional but recommended, declare the Python requirements required # to build your documentation # See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html python: install: - requirements: "docs/requirements.txt" datapoint-python-0.13.0/CHANGELOG.md000066400000000000000000000125261474201672100167200ustar00rootroot00000000000000# Changelog The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] ## [0.13.0] - 2025-01-15 + Remove python 3.8 support + Update GitHub location in docs ## [0.12.1] - 2024-11-28 + Fix bug in API request when twice-daily forecast was used. ## [0.12.0] - 2024-11-27 + Use one timestep per day for daily forecasts. + Add twice-daily forecast option to split daily forecasts into day and night. + No longer strip 'day', 'night', 'midday', 'midnight' from element names in daily and twice-daily forecasts. ## [0.11.0] - 2024-11-26 + Correct elements to camelCase for daily forecasts. + Add option to convert numeric significant weather code to string description ## [0.10.0] - 2024-11-17 + Modernise packaging and build tooling and infrastructure. + Migrate to use new MetOffice DataHub. This required many changes, for more details see the 'migration' page of the documentation. ## [0.9.9] - 2024-02-09 + Update versioneer + Add pythons 3.9, 3.10, 3.11, 3.12 to tests and setup.py. + Remove support for python < 3.8 + Remove deprecated `new_old` and `future_old` functions. + Add `__str__` functions to `Timestep`, `Element`, `Day`, `Site` + Add element to `Forecast` to track if forecast is daily or 3 hourly + Change `id` variable in `Forecast`, `Observation`, `Site` to `location_id`. + Change `id` variable in `Element` to `field_code`. ## [0.9.8] - 2020-07-03 + Remove f-string in test ## [0.9.7] - 2020-07-03 + Bugfix for `get_observation_sites` ## [0.9.6] - 2020-05-05 + Require arguments to `get_nearest_forecast_site` and `get_nearest_observation_site`. + Add python 3.8 to tests and setup.py ## [0.9.5] - 2019-10-01 + Remove support for Python 3.4. ## [0.9.4] - 2019-09-10 + Fix to url case in `travis.yml` to enable releases. ## [0.9.3] - 2019-09-10 + Update README.md and travis.yml due to change in ownership. ## [0.9.2] - 2019-07-26 + Raise an error if data for the requested location is not provided from the datapoint API. ## [0.9.1] - 2019-05-21 + Remove stray print statement ## [0.9.0] - 2019-05-18 + Explicitly state the use of semantic versioning in `README.md`. + Add `elements()` function to `Timestep`. + Remove night/day indication from weather codes which have them. + Change the logic used to calculate the closest timestep to a datetime. The closest timestep to the datetime is now used. Add a new function, `Forecast.at_datetime(target)` to do this. `Forecast.now()` has been changed to use this new function. The old behaviour is deprecated and available using `Forecast.now_old()`. `Forecast.future()` has been changed to use this new function. The old behaviour is deprecated and available using `Forecast.future_old()`. + Check if keys are returned from datapoint api in `Manager.py`. Do not attempt to read the values from the dict if they are not there. ## [0.8.0] - 2019-04-05 + Retry the connection to datapoint if it fails (up to 10 times). + Use versioneer to set version number from git tag. + Fix failure to return forecast at midnight. + Add changelog. ## [0.7.0] - 2019-02-19 + Check that data is provided in tests. + Set weather element of `timestep` to 'not reported' if data is not provided. + Update examples to use `get_nearest_forecast_site` function. + Rename `get_all_sites()` to `get_forecast_sites()` and `get_nearest_site()` to `get_nearest_forecast_site()`. + Limit observations to sites within 20 km of the nearest observation site. + Require that the nearest location is within 30 km of the requested location. + Show the available sites on maps in the documentation. + Use a haversine function to calculate the distance between coordinates. + Use setuptools in `setup.py`. + Fix bug where site attributes were assigned incorrectly. + Use sphinx to generate documentation. + Fix bug where longitude or latitude values of 0 returned false in `get_nearest_site()`. ## [0.6.1] - 2019-01-26 + Remove stray print statements. ## [0.6.0] - 2019-01-26 + Remove support for python 2 and python 3.3. ## [0.5.1] - 2019-01-26 + Correct wrong version number. ## [0.5.0] - 2019-01-26 + Fix latitude and longitude in `manager_test.py`. + Add support for observations. + Swap the order of latitude and longitude in function calls. + Add a timeout of 1 second to the API call. + Fix error which set sites to `None`. + Fix documentation build. + Use python 3 syntax in examples. + Fix bug where `forecast.now()` always returned `None`. + Change print statements in `Manager.py` and `Forecast.py` to python 3 style. + Fix bug where no data was returned for about an hour after midnight. + Add `forecast.future()` function. + Add support for python 3.6. ## [0.4.3] - 2017-01-19 + Use a custom error when datapoint call fails. ## [0.4.2] - 2017-01-18 + Only send python 3.5 to Travis. ## [0.4.1] - 2017-01-04 + Update tests. + Fix bug with `forecast.now()`. + Implement text forecast. ## [0.4.0] - 2016-06-06 + Add python 3 support. ## [0.3.0] - 2016-01-06 + Use python datetime for dates and times. + Add instructions for installing from master using pip. ## [0.2.2] - 2014-10-24 + Add examples + Use readthedocs. + Add error when no data is returned. + Cache site requests for an hour. ## [0.2.1] - 2014-10-17 + Test string to int conversion. ## [0.2] - 2014-10-10 + Use travis + Add concept of API key profiles. + Fix type casting. + Add `forecast.now()` function. ## [0.1] - 2014-07-16 + Initial commit and license. datapoint-python-0.13.0/LICENSE000066400000000000000000001033021474201672100161050ustar00rootroot00000000000000GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Datapoint Python, a Python library for the Met Office Datapoint API. Copyright (C) 2016 Jacob Tomlinson This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Datapoint Python Copyright (C) 2016 Jacob Tomlinson This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . datapoint-python-0.13.0/MANIFEST000066400000000000000000000005541474201672100162360ustar00rootroot00000000000000# file GENERATED by distutils, do NOT edit setup.py datapoint/Day.py datapoint/Element.py datapoint/Forecast.py datapoint/Manager.py datapoint/Observation.py datapoint/Site.py datapoint/Timestep.py datapoint/__init__.py datapoint/exceptions.py datapoint/profile.py datapoint/regions/RegionManager.py datapoint/regions/__init__.py datapoint/regions/region_names.py datapoint-python-0.13.0/README.md000066400000000000000000000052541474201672100163660ustar00rootroot00000000000000# _DataPoint for Python_ [![PyPi version](https://img.shields.io/pypi/v/datapoint.svg)](https://pypi.python.org/pypi/datapoint/) [![Supported Python versions](https://img.shields.io/pypi/pyversions/datapoint.svg)](https://pypi.python.org/pypi/datapoint/) [![Documentation Status](https://readthedocs.org/projects/datapoint-python/badge/?version=latest)](https://readthedocs.org/projects/datapoint-python/) _A Python module for accessing weather data via the [Met Office](http://www.metoffice.gov.uk/)'s open data API known as [DataPoint](http://www.metoffice.gov.uk/datapoint)._ __For personal reasons I have changed my GitHub username. The repository location has changed. The homepage link on PyPi is up-to-date__ __Disclaimer: This module is in no way part of the DataPoint project/service. This module is intended to simplify the use of DataPoint for small Python projects (e.g school projects). No support for this module is provided by the Met Office and may break as the DataPoint service grows/evolves. The author will make reasonable efforts to keep it up to date and fully featured.__ ## Features * List forecast sites * Get nearest forecast site from latitiude and longitude * Get the following 5 day forecast types for any site * Daily (Two timesteps, midday and midnight UTC) * 3 hourly (Eight timesteps, every 3 hours starting at midnight UTC) ## Installation ```Bash $ pip install DataPoint ``` You will also require a [DataPoint API key](http://www.metoffice.gov.uk/datapoint/API). For more installation methods see the [installation guide](http://datapoint-python.readthedocs.org/en/latest/install/). ## Documentation Detailed documentation for this project is available on [Read the Docs](http://datapoint-python.readthedocs.org/en/latest). This project uses semantic versioning as defined at [semver.org](https://semver.org/). ## Example Usage ```Python import datapoint # Create connection to DataPoint with your API key conn = datapoint.connection(api_key="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") # Get the nearest site for my latitude and longitude site = conn.get_nearest_forecast_site(51.500728, -0.124626) # Get a forecast for my nearest site with 3 hourly timesteps forecast = conn.get_forecast_for_site(site.location_id, "3hourly") # Get the current timestep from the forecast current_timestep = forecast.now() # Print out the site and current weather print(site.name + "-" + current_timestep.weather.text) ``` Example output ``` London - Heavy rain ``` See [examples directory](https://github.com/Perseudonymous/datapoint-python/tree/master/examples) for more in depth examples. ## Contributing changes Please feel free to submit issues and pull requests. ## License GPLv3 datapoint-python-0.13.0/docs/000077500000000000000000000000001474201672100160315ustar00rootroot00000000000000datapoint-python-0.13.0/docs/Makefile000066400000000000000000000011761474201672100174760ustar00rootroot00000000000000# Minimal makefile for Sphinx documentation # # You can set these variables from the command line, and also # from the environment for the first two. SPHINXOPTS ?= SPHINXBUILD ?= sphinx-build SOURCEDIR = source BUILDDIR = build # Put it first so that "make" without argument is like "make help". help: @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) .PHONY: help Makefile # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) datapoint-python-0.13.0/docs/make.bat000066400000000000000000000014441474201672100174410ustar00rootroot00000000000000@ECHO OFF pushd %~dp0 REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) set SOURCEDIR=source set BUILDDIR=build %SPHINXBUILD% >NUL 2>NUL if errorlevel 9009 ( echo. echo.The 'sphinx-build' command was not found. Make sure you have Sphinx echo.installed, then set the SPHINXBUILD environment variable to point echo.to the full path of the 'sphinx-build' executable. Alternatively you echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from echo.https://www.sphinx-doc.org/ exit /b 1 ) if "%1" == "" goto help %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% goto end :help %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% :end popd datapoint-python-0.13.0/docs/requirements.txt000066400000000000000000000000141474201672100213100ustar00rootroot00000000000000sphinx -e . datapoint-python-0.13.0/docs/source/000077500000000000000000000000001474201672100173315ustar00rootroot00000000000000datapoint-python-0.13.0/docs/source/api-reference.rst000066400000000000000000000001751474201672100225730ustar00rootroot00000000000000API reference ============= .. automodule:: datapoint.Manager :members: .. automodule:: datapoint.Forecast :members: datapoint-python-0.13.0/docs/source/conf.py000066400000000000000000000021061474201672100206270ustar00rootroot00000000000000# Configuration file for the Sphinx documentation builder. # # For the full list of built-in configuration values, see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information import importlib project = "datapoint-python" copyright = "2024, Emily Price, Jacob Tomlinson" author = "Emily Price, Jacob Tomlinson" release = importlib.metadata.version("datapoint") version = importlib.metadata.version("datapoint") # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration extensions = [ "sphinx.ext.autodoc", ] templates_path = ["_templates"] exclude_patterns = [] # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output html_theme = "alabaster" html_static_path = ["_static"] datapoint-python-0.13.0/docs/source/getting-started.rst000066400000000000000000000037731474201672100232020ustar00rootroot00000000000000Getting started =============== Getting started with DataHub for Python is simple and you can write a simple script which prints out data in just 6 lines of Python. API Key ------- To access DataPoint you need to `register `__ with the Met Office and get yourself an API key. The process is simple and just ensures that you don’t abuse the service. You will need access to the Site-Specific forecast API. Connecting to DataHub ----------------------- Now that you have an API key you can import the module: :: import datapoint And create a connection to DataHub: :: manager = datapoint.Manager(api_key="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") This creates a `manager` object which manages the connection and interacts with DataHub. Getting data from DataHub --------------------------- So now that you have a Manager object with a connection to DataHub you can request some data. To do this, use the `manager` object: :: forecast = manager.get_forecast(51, 0, "hourly", convert_weather_code=True) This takes four parameters: the latitude and longitude of the location you want a forecast for, a forecast type of “hourly” and an instruction to convert the numeric weather code to a string description. We’ll discuss the forecast types later on. This Forecast Object which has been returned to us contains lots of information which we will cover in a later section, right now we’re just going to get the data for the current time: :: current_weather = forecast.now() This is a dict which contains many different details about the weather but for now we’ll just print out one field. :: print(current_weather["feelsLikeTemperature"]) And there you have it. If you followed all the steps you should have printed out the current weather for your chosen location. Further Examples ---------------- For more code examples please have a look in the `examples folder `__ in the GitHub project. datapoint-python-0.13.0/docs/source/index.rst000066400000000000000000000006231474201672100211730ustar00rootroot00000000000000.. datapoint-python documentation master file, created by sphinx-quickstart on Tue Nov 12 17:56:23 2024. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. datapoint-python documentation ============================== .. toctree:: :maxdepth: 2 :caption: Contents: install getting-started migration api-reference datapoint-python-0.13.0/docs/source/install.rst000066400000000000000000000021731474201672100215340ustar00rootroot00000000000000Installation ============ DataPoint for Python can be installed like any other Python module. It is available on `PyPI `__ and the source is available on `GitHub `__. Pip --- `Pip `__ makes Python package installation simple. For the latest stable version just fire up your terminal and run: :: pip install datapoint or for the very latest code from the repository’s master branch run: :: pip install git+git://github.com/perseudonymous/datapoint-python.git@master and to upgrade it in the future: :: pip install git+git://github.com/perseudonymous/datapoint-python.git@master --upgrade Source ------ You can also install from the source in GitHub. First checkout the GitHub repository (or you can `download the zip `__ and extract it). :: git clone https://github.com/perseudonymous/datapoint-python.git datapoint-python Navigate to that directory :: cd datapoint-python Then run the setup :: python setup.py install datapoint-python-0.13.0/docs/source/migration.rst000066400000000000000000000074101474201672100220560ustar00rootroot00000000000000Migration from DataPoint ======================== The new APIs the Met Office provide via DataHub are very different in behaviour to the old APIs which were provided via DataPoint. As such this library has changed greatly. The main changes are below. No concept of 'sites' --------------------- There is no concept of retrieving a site id for a location before requesting a forecast. Now a latitude and longitude are provided to the library directly. No observations --------------- The new API does not provide 'observations' like DataPoint. However, the current state of the weather is returned as part of the forecast responses. As such, this library no longer provides separate 'observations'. Simplified object hierarchy --------------------------- Python dicts are used instead of classes to allow more flexibility with handling data returned from the MetOffice API, and because new MetOffice API provides data with a more convenient structure. The concept of 'Days' has also been removed from the library and instead all time steps are provided in one list. The data structure for a single time step is:: { 'time': datetime.datetime(2024, 2, 19, 13, 0, tzinfo=datetime.timezone.utc), 'screenTemperature': { 'value': 10.09, 'description': 'Screen Air Temperature', 'unit_name': 'degrees Celsius', 'unit_symbol': 'Cel' }, 'screenDewPointTemperature': { 'value': 8.08, 'description': 'Screen Dew Point Temperature', 'unit_name': 'degrees Celsius', 'unit_symbol': 'Cel' }, 'feelsLikeTemperature': { 'value': 6.85, 'description': 'Feels Like Temperature', 'unit_name': 'degrees Celsius', 'unit_symbol': 'Cel' }, 'windSpeed10m': { 'value': 7.57, 'description': '10m Wind Speed', 'unit_name': 'metres per second', 'unit_symbol': 'm/s' }, 'windDirectionFrom10m': { 'value': 263, 'description': '10m Wind From Direction', 'unit_name': 'degrees', 'unit_symbol': 'deg' }, 'windGustSpeed10m': { 'value': 12.31, 'description': '10m Wind Gust Speed', 'unit_name': 'metres per second', 'unit_symbol': 'm/s' }, 'visibility': { 'value': 21201, 'description': 'Visibility', 'unit_name': 'metres', 'unit_symbol': 'm' }, 'screenRelativeHumidity': { 'value': 87.81, 'description': 'Screen Relative Humidity', 'unit_name': 'percentage', 'unit_symbol': '%' }, 'mslp': { 'value': 103080, 'description': 'Mean Sea Level Pressure', 'unit_name': 'pascals', 'unit_symbol': 'Pa' }, 'uvIndex': { 'value': 1, 'description': 'UV Index', 'unit_name': 'dimensionless', 'unit_symbol': '1' }, 'significantWeatherCode': { 'value': 'Cloudy', 'description': 'Significant Weather Code', 'unit_name': 'dimensionless', 'unit_symbol': '1' }, 'precipitationRate': { 'value': 0.0, 'description': 'Precipitation Rate', 'unit_name': 'millimetres per hour', 'unit_symbol': 'mm/h' }, 'probOfPrecipitation': { 'value': 21, 'description': 'Probability of Precipitation', 'unit_name': 'percentage', 'unit_symbol': '%' } } Different data provided ----------------------- There are some differences in what data are provided in each weather forecast compared to the old DataPoint API, and in the names of the features. datapoint-python-0.13.0/examples/000077500000000000000000000000001474201672100167175ustar00rootroot00000000000000datapoint-python-0.13.0/examples/README.md000066400000000000000000000021131474201672100201730ustar00rootroot00000000000000# Examples ## Getting started _Examples of getting data from DataPoint._ * [Current Weather](current_weather/) - Get the current weather for a specified latitude and longitude. * [Simple Forecast](simple_forecast/) - Get a full 5 day forecast for a specified latitude and longitude. ## Making Decisions _Examples which make decisions based on weather data._ * [Umbrella](umbrella/) - Inform the user whether they need an umbrella today for a specified latitude and longitude. * [Washing](washing/) - Inform the user which day in the next 5 days would be the best for hanging out their washing for a specified latitude and longitude. ## Mixing Data _Examples which makes use of other API's in conjunction with DataPoint._ * [Tube or Bike](tube_bike/) - Inform the user whether they should cycle or take the tube across London, based on weather and tube service for two sets of longitude and latitude along with a tube line name. * [Postcodes](postcodes_to_lat_lng) - A variation on the [Current Weather](current_weather/) example but uses UK postcodes instead of latitude and longitude. datapoint-python-0.13.0/examples/current_weather/000077500000000000000000000000001474201672100221205ustar00rootroot00000000000000datapoint-python-0.13.0/examples/current_weather/README.md000066400000000000000000000005771474201672100234100ustar00rootroot00000000000000# Current Weather _This example displays the current weather and temperature for your location._ ### Required Modules * [datapoint](https://github.com/perseudonymous/datapoint-python) ## Learning Objective Learn how to simply connect to DataPoint and print out some data. ## Example Usage ```Shell python current_weather.py ``` ## Example Output ``` London Cloudy 18°C ``` datapoint-python-0.13.0/examples/current_weather/current_weather.py000066400000000000000000000010741474201672100256750ustar00rootroot00000000000000#!/usr/bin/env python """ This is a simple example which will print out the current weather and temperature for our location. """ import datapoint # Create datapoint connection manager = datapoint.Manager(api_key="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") # Get a forecast for the nearest location forecast = manager.get_forecast(51.500728, -0.124626, "hourly") # Get the current timestep using now() and print out some info now = forecast.now() print(now["significantWeatherCode"]) print(f"{now['screenTemperature']['value']} {now['screenTemperature']['unit_symbol']}") datapoint-python-0.13.0/examples/postcodes_to_lat_lng/000077500000000000000000000000001474201672100231245ustar00rootroot00000000000000datapoint-python-0.13.0/examples/postcodes_to_lat_lng/README.md000066400000000000000000000007701474201672100244070ustar00rootroot00000000000000# Current Weather _A variation on current_weather.py which uses postcodes rather than lon lat._ ### Required Modules * [datapoint](https://github.com/perseudonymous/datapoint-python) * [python-postcodes-io](https://github.com/raigad/python-postcodes-io) ## Learning Objective Learn how to make use of the postcodes module to make it even simpler to access Met Office data. ## Example Usage ```Shell python postcodes_to_lat_lng.py ``` ## Example Output ``` Horseguards Parade Overcast 15°C ``` datapoint-python-0.13.0/examples/postcodes_to_lat_lng/postcodes_to_lat_lng.py000066400000000000000000000014261474201672100277060ustar00rootroot00000000000000#!/usr/bin/env python """ A variation on current_weather.py which uses postcodes rather than lon lat. """ import postcodes_io_api import datapoint # Create datapoint connection manager = datapoint.Manager(api_key="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") # Get longitude and latitude from postcode postcodes_conn = postcodes_io_api.Api() postcode = postcodes_conn.get_postcode("SW1A 2AA") latitude = postcode["result"]["latitude"] longitude = postcode["result"]["longitude"] # Get a forecast for the nearest site forecast = manager.get_forecast(longitude, latitude, "hourly") # Get the current timestep using now() and print out some info now = forecast.now() print(now["significantWeatherCode"]) print(f"{now['screenTemperature']['value']} {now['screenTemperature']['unit_symbol']}") datapoint-python-0.13.0/examples/simple_forecast/000077500000000000000000000000001474201672100220765ustar00rootroot00000000000000datapoint-python-0.13.0/examples/simple_forecast/README.md000066400000000000000000000025371474201672100233640ustar00rootroot00000000000000# Simple Forecast _This example gets a 5 day forecast for your location and prints out some values from each timestep for each day._ ### Required Modules * [datapoint](https://github.com/perseudonymous/datapoint-python) ## Learning Objective Explore the day and timestep objects and loop through them. ## Example Usage ```Shell python simple_forecast.py ``` ## Example Output ``` London 2014-10-18Z 180 Partly cloudy (night) 17°C 360 Cloudy 18°C 540 Light rain shower (day) 18°C 720 Light rain 18°C 900 Cloudy 19°C 1080 Cloudy 18°C 1260 Cloudy 18°C 2014-10-19Z 0 Cloudy 18°C 180 Light rain 17°C 360 Heavy rain 17°C 540 Cloudy 17°C 720 Cloudy 18°C 900 Partly cloudy (day) 18°C 1080 Partly cloudy (night) 17°C 1260 Overcast 15°C 2014-10-20Z 0 Overcast 14°C 180 Light rain shower (night) 14°C 360 Partly cloudy (night) 13°C 540 Partly cloudy (day) 13°C 720 Cloudy 15°C 900 Cloudy 15°C 1080 Cloudy 14°C 1260 Cloudy 13°C 2014-10-21Z 0 Cloudy 13°C 180 Light rain shower (night) 13°C 360 Light rain shower (night) 14°C 540 Light rain shower (day) 13°C 720 Light rain shower (day) 13°C 900 Sunny day 13°C 1080 Clear night 12°C 1260 Partly cloudy (night) 10°C 2014-10-22Z 0 Clear night 10°C 180 Clear night 9°C 360 Partly cloudy (night) 9°C 540 Cloudy 10°C 720 Cloudy 13°C 900 Cloudy 15°C 1080 Overcast 14°C 1260 Overcast 13°C ``` datapoint-python-0.13.0/examples/simple_forecast/simple_forecast.py000077500000000000000000000014541474201672100256360ustar00rootroot00000000000000#!/usr/bin/env python """ This example will print out a simple forecast for the next 5 days. It will allow us to explore the day, timestep and element objects. """ import datetime import datapoint # Create datapoint connection manager = datapoint.Manager(api_key="api key goes here") forecast = manager.get_forecast(51.500728, -0.124626, frequency="hourly") # Loop through timesteps and print information for timestep in forecast.timesteps: print(timestep["time"]) print(timestep["significantWeatherCode"]["value"]) print( "{temp} {temp_units}".format( temp=timestep["screenTemperature"]["value"], temp_units=timestep["screenTemperature"]["unit_symbol"], ) ) print(forecast.now()) print(forecast.at_datetime(datetime.datetime(2024, 2, 11, 14, 0))) datapoint-python-0.13.0/examples/tube_bike/000077500000000000000000000000001474201672100206505ustar00rootroot00000000000000datapoint-python-0.13.0/examples/tube_bike/README.md000066400000000000000000000010201474201672100221200ustar00rootroot00000000000000# Bike or Tube _This example uses open weather data in conjunction with open transport data for London to advise you on whether you should cycle or catch the tube around London._ ### Required Modules * [datapoint](https://github.com/perseudonymous/datapoint-python) * [tubestatus](https://github.com/jacobtomlinson/tube-status) ## Learning Objective Discover how to mix multiple data sources together. ## Example Usage ```Shell python tube_bike.py ``` ## Example Output ``` Bad service on the tube, cycling it is! ``` datapoint-python-0.13.0/examples/tube_bike/tube_bike.py000066400000000000000000000035621474201672100231610ustar00rootroot00000000000000#!/usr/bin/env python """ This one's for Londoners. Get the weather for home and work and get the tube status for your usual line. Then use that information to decide whether you're better off cycling or catching the tube. """ import tubestatus import datapoint # Create datapoint connection manager = datapoint.Manager(api_key="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") # Get a forecast for my house and work my_house_forecast = manager.get_forecast(51.5016730, 0.0057500, "hourly") work_forecast = manager.get_forecast(51.5031650, -0.1123050, "hourly") # Get the current timestep for both locations my_house_now = my_house_forecast.now() work_now = work_forecast.now() # Create a tube status connection current_status = tubestatus.Status() # Get the status of the Waterloo and City line waterloo_status = current_status.get_status("Waterloo and City") # Check whether there are any problems with rain or the tube if ( my_house_now["probOfPrecipitation"]["value"] < 40 and work_now["probOfPrecipitation"]["value"] < 40 and waterloo_status.description == "Good Service" ): print("Rain is unlikely and tube service is good, the decision is yours.") # If it is going to rain then suggest the tube elif ( my_house_now["probOfPrecipitation"]["value"] >= 40 or work_now["probOfPrecipitation"]["value"] >= 40 ) and waterloo_status.description == "Good Service": print("Looks like rain, better get the tube") # If the tube isn't running then suggest cycling elif ( my_house_now["probOfPrecipitation"]["value"] < 40 and work_now["probOfPrecipitation"]["value"] < 40 and waterloo_status.description != "Good Service" ): print("Bad service on the tube, cycling it is!") # Else if both are bad then suggest cycling in the rain else: print( "The tube has poor service so you'll have to cycle," " but it's raining so take your waterproofs." ) datapoint-python-0.13.0/examples/umbrella/000077500000000000000000000000001474201672100205225ustar00rootroot00000000000000datapoint-python-0.13.0/examples/umbrella/README.md000066400000000000000000000007521474201672100220050ustar00rootroot00000000000000# Do I need an umbrella _This example checks the forecast for your current location to see if it is going to rain at any stage today. If so it will suggest that you take an umbrella._ ### Required Modules * [datapoint](https://github.com/perseudonymous/datapoint-python) ## Learning Objective Make a simple decision based on the data provided by DataPoint. ## Example Usage ```Shell python umbrella.py ``` ## Example Output ``` London Looks like rain! Better take an umbrella. ``` datapoint-python-0.13.0/examples/umbrella/umbrella.py000077500000000000000000000016321474201672100227040ustar00rootroot00000000000000#!/usr/bin/env python """ This example checks whether it is due to rain at any point today and then decides if we need to take an umbrella. """ import datetime import datapoint # Create umbrella variable to use later umbrella = False # Create datapoint connection manager = datapoint.Manager(api_key="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") # Get a forecast for the nearest site forecast = manager.get_forecast(51.500728, -0.124626, "hourly") # Loop through all the timesteps in day 0 (today) for timestep in forecast.timesteps: # Check to see if the chance of rain is more than 20% at any point if ( timestep["probOfPrecipitation"]["value"] > 20 and timestep["time"].date == datetime.date.now() ): umbrella = True # Print out the results if umbrella is True: print("Looks like rain! Better take an umbrella.") else: print("Don't worry you don't need an umbrella today.") datapoint-python-0.13.0/examples/washing/000077500000000000000000000000001474201672100203575ustar00rootroot00000000000000datapoint-python-0.13.0/examples/washing/README.md000066400000000000000000000007551474201672100216450ustar00rootroot00000000000000# When should I do my washing? _This example looks at the forecast for the next 5 days and suggests which day (if any) would be best for hanging your washing out to dry._ ### Required Modules * [datapoint](https://github.com/perseudonymous/datapoint-python) ## Learning Objective Make a slightly more complex decision by comparing values provided by DataPoint. ## Example Usage ```Shell python washing.py ``` ## Example Output ``` London Monday is the best day with a score of 26 ``` datapoint-python-0.13.0/examples/washing/washing.py000066400000000000000000000045231474201672100223750ustar00rootroot00000000000000#!/usr/bin/env python """ This example will tell us which day would be best to hang out our washing to dry. We will loop over the next 5 days and decide whether it is ok to hang out the washing. Then for the good days we will rank them and print out the best. """ import datapoint # Set thresholds MAX_WIND = 31 # in mph. We don't want the washing to blow away MAX_PRECIPITATION = 20 # Max chance of rain we will accept # Variables for later best_time = None best_score = 0 # For simplicity the score will be temperature + wind speed # Create datapoint connection manager = datapoint.Manager(api_key="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") # Get a forecast for the nearest site forecast = manager.get_forecast(51.500728, -0.124626, "daily") # Loop through days for day in forecast.days: # Get the 'Day' timestep if day.timesteps[0].name == "Day": timestep = day.timesteps[0] # If precipitation, wind speed and gust are less than their threshold if ( timestep.precipitation.value < MAX_PRECIPITATION and timestep.wind_speed.value < MAX_WIND and timestep.wind_gust.value < MAX_WIND ): # Calculate the score for this timestep timestep_score = timestep.wind_speed.value + timestep.temperature.value # If this timestep scores better than the current best replace it if timestep_score > best_score: best_score = timestep_score best_day = day.date for timestep in forecast.timesteps: # If precipitation, wind speed and gust are less than their threshold if ( timestep.precipitation.value < MAX_PRECIPITATION and timestep.wind_speed.value < MAX_WIND and timestep.wind_gust.value < MAX_WIND ): # Calculate the score for this timestep timestep_score = ( timestep["windSpeed10m"]["value"] + timestep["screenTemperature"]["value"] ) # If this timestep scores better than the current best replace it if timestep_score > best_score: best_score = timestep_score best_time = timestep["time"] # If best_day is still None then there are no good days if best_time is None: print("Better use the tumble dryer") # Otherwise print out the day else: print(f"{best_time} is the best day with a score of {best_score}") datapoint-python-0.13.0/pyproject.toml000066400000000000000000000027501474201672100200210ustar00rootroot00000000000000[build-system] requires = ["hatchling", "versioningit"] build-backend = "hatchling.build" [project] name = "datapoint" dynamic = ["version"] authors = [ {name="Emily Price", email="emily.j.price.nth@gmail.com"}, { name="Jacob Tomlinson"}, ] description = "Python interface to the Met Office's Datapoint API" readme = "README.md" requires-python = ">=3.9" classifiers=[ "Development Status :: 3 - Alpha", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", ] dependencies = [ "requests >= 2.20.0,<3", "appdirs >=1,<2", "geojson >= 3.0.0,<4", ] license = {file = "LICENSE"} keywords = ["weather", "weather forecast", "Met Office", "DataHub"] [project.urls] Homepage = "https://github.com/Perseudonymous/datapoint-python" Documentation = "http://datapoint-python.readthedocs.org/en/latest" [tool.hatch.build.targets.sdist] exclude = [ "tests/", "examples/", ] [tool.hatch.version] source = "versioningit" [tool.isort] profile = "black" src_paths = ["src", "tests"] [tool.versioningit.format] distance = "{base_version}+post{distance}{vcs}{rev}" distance-dirty = "{base_version}+post{distance}{vcs}{rev}.d{build_date:%Y%m%d}" [tool.versioningit.vcs] default-tag = "0.0.1" [tool.pytest.ini_options] addopts = [ "--import-mode=importlib", ] datapoint-python-0.13.0/requirements-dev.txt000066400000000000000000000001371474201672100211420ustar00rootroot00000000000000black==24.* isort==5.* flake8==7.* flake8-bugbear==24.* flake8-pytest-style==2.* pytest==8.* . datapoint-python-0.13.0/src/000077500000000000000000000000001474201672100156705ustar00rootroot00000000000000datapoint-python-0.13.0/src/datapoint/000077500000000000000000000000001474201672100176535ustar00rootroot00000000000000datapoint-python-0.13.0/src/datapoint/Forecast.py000066400000000000000000000472371474201672100220100ustar00rootroot00000000000000import datetime from datapoint.exceptions import APIException from datapoint.weather_codes import WEATHER_CODES class Forecast: """Forecast data returned from DataHub Provides access to forecasts as far ahead as provided by DataHub. See the DataHub documentation for the latest limits on the forecast range. The values of data from DataHub are combined with the unit information and description and returned as a dict. Basic Usage:: >>> import datapoint >>> m = datapoint.Manager.Manager(api_key = "blah") >>> f = m.get_forecast( latitude=50, longitude=0, frequency="hourly", convert_weather_code=True, ) >>> f.now() { 'time': datetime.datetime(2024, 2, 19, 13, 0, tzinfo=datetime.timezone.utc), 'screenTemperature': { 'value': 10.09, 'description': 'Screen Air Temperature', 'unit_name': 'degrees Celsius', 'unit_symbol': 'Cel' }, 'screenDewPointTemperature': { 'value': 8.08, 'description': 'Screen Dew Point Temperature', 'unit_name': 'degrees Celsius', 'unit_symbol': 'Cel' }, 'feelsLikeTemperature': { 'value': 6.85, 'description': 'Feels Like Temperature', 'unit_name': 'degrees Celsius', 'unit_symbol': 'Cel' }, 'windSpeed10m': { 'value': 7.57, 'description': '10m Wind Speed', 'unit_name': 'metres per second', 'unit_symbol': 'm/s' }, 'windDirectionFrom10m': { 'value': 263, 'description': '10m Wind From Direction', 'unit_name': 'degrees', 'unit_symbol': 'deg' }, 'windGustSpeed10m': { 'value': 12.31, 'description': '10m Wind Gust Speed', 'unit_name': 'metres per second', 'unit_symbol': 'm/s' }, 'visibility': { 'value': 21201, 'description': 'Visibility', 'unit_name': 'metres', 'unit_symbol': 'm' }, 'screenRelativeHumidity': { 'value': 87.81, 'description': 'Screen Relative Humidity', 'unit_name': 'percentage', 'unit_symbol': '%' }, 'mslp': { 'value': 103080, 'description': 'Mean Sea Level Pressure', 'unit_name': 'pascals', 'unit_symbol': 'Pa' }, 'uvIndex': { 'value': 1, 'description': 'UV Index', 'unit_name': 'dimensionless', 'unit_symbol': '1' }, 'significantWeatherCode': { 'value': 'Cloudy', 'description': 'Significant Weather Code', 'unit_name': 'dimensionless', 'unit_symbol': '1' }, 'precipitationRate': { 'value': 0.0, 'description': 'Precipitation Rate', 'unit_name': 'millimetres per hour', 'unit_symbol': 'mm/h' }, 'probOfPrecipitation': { 'value': 21, 'description': 'Probability of Precipitation', 'unit_name': 'percentage', 'unit_symbol': '%' } } """ def __init__(self, frequency, api_data, convert_weather_code): """ :param frequency: Frequency of forecast: 'hourly', 'three-hourly', 'twice-daily', 'daily' :param api_data: Data returned from API call :param: convert_weather_code: Convert numeric weather codes to string description :type frequency: string :type api_data: dict :type convert_weather_code: bool """ self.frequency = frequency # Need to parse format like 2024-02-17T15:00Z. This can only be # done with datetime.datetime.fromisoformat from python 3.11 # onwards. self.data_date = datetime.datetime.strptime( api_data["features"][0]["properties"]["modelRunDate"], "%Y-%m-%dT%H:%M%z", ) #: The date the provided forecast was generated. self.forecast_longitude = api_data["features"][0]["geometry"]["coordinates"][ 0 ] #: The longitude of the provided forecast. self.forecast_latitude = api_data["features"][0]["geometry"]["coordinates"][ 1 ] #: The latitude of the provided forecast. self.distance_from_requested_location = api_data["features"][0]["properties"][ "requestPointDistance" ] #: The distance of the location of the provided forecast from the requested location self.name = api_data["features"][0]["properties"]["location"][ "name" ] #: The name of the location of the provided forecast # N.B. Elevation is in metres above or below the WGS 84 reference # ellipsoid as per GeoJSON spec. self.elevation = api_data["features"][0]["geometry"]["coordinates"][ 2 ] #: The elevation of the location of the provided forecast self.convert_weather_code = ( convert_weather_code #: Convert numeric weather codes to string description ) forecasts = api_data["features"][0]["properties"]["timeSeries"] parameters = api_data["parameters"][0] if frequency == "twice-daily": self.timesteps = self._build_twice_daily_timesteps(forecasts, parameters) else: self.timesteps = [] for forecast in forecasts: self.timesteps.append(self._build_timestep(forecast, parameters)) def _build_twice_daily_timesteps(self, forecasts, parameters): """Build individual timesteps from forecasts and metadata Take the forecast data from DataHub and combine with unit information in each timestep. Break each day into day and night steps. ASSUME that each step has data for the night referred to in the timestamp and the following dawn-dusk period. :parameter forecasts: Forecast data from DataHub :parameter parameters: Unit information from DataHub :type forecasts: list :type parameters: dict :return: List of timesteps :rtype: list """ timesteps = [] for forecast in forecasts: # Need to parse format like 2024-02-17T15:00Z. This can only be # done with datetime.datetime.fromisoformat from python 3.11 # onwards. night_step = { "time": datetime.datetime.strptime(forecast["time"], "%Y-%m-%dT%H:%M%z") } day_step = { "time": datetime.datetime.strptime(forecast["time"], "%Y-%m-%dT%H:%M%z") + datetime.timedelta(hours=12) } for element, value in forecast.items(): if element.startswith("midday"): day_step[element] = { "value": value, "description": parameters[element]["description"], "unit_name": parameters[element]["unit"]["label"], "unit_symbol": parameters[element]["unit"]["symbol"]["type"], } elif element.startswith("midnight"): night_step[element] = { "value": value, "description": parameters[element]["description"], "unit_name": parameters[element]["unit"]["label"], "unit_symbol": parameters[element]["unit"]["symbol"]["type"], } elif element.startswith("day"): if ( element == "daySignificantWeatherCode" and self.convert_weather_code ): day_step[element] = { "value": WEATHER_CODES[str(value)], "description": parameters[element]["description"], "unit_name": parameters[element]["unit"]["label"], "unit_symbol": parameters[element]["unit"]["symbol"][ "type" ], } else: day_step[element] = { "value": value, "description": parameters[element]["description"], "unit_name": parameters[element]["unit"]["label"], "unit_symbol": parameters[element]["unit"]["symbol"][ "type" ], } elif element.startswith("night"): if ( element == "nightSignificantWeatherCode" and self.convert_weather_code ): night_step[element] = { "value": WEATHER_CODES[str(value)], "description": parameters[element]["description"], "unit_name": parameters[element]["unit"]["label"], "unit_symbol": parameters[element]["unit"]["symbol"][ "type" ], } else: night_step[element] = { "value": value, "description": parameters[element]["description"], "unit_name": parameters[element]["unit"]["label"], "unit_symbol": parameters[element]["unit"]["symbol"][ "type" ], } elif element == "maxUvIndex": day_step[element] = { "value": value, "description": parameters[element]["description"], "unit_name": parameters[element]["unit"]["label"], "unit_symbol": parameters[element]["unit"]["symbol"]["type"], } timesteps.append(night_step) timesteps.append(day_step) timesteps = sorted(timesteps, key=lambda t: t["time"]) return timesteps def _build_timestep(self, forecast, parameters): """Build individual timestep from forecast and metadata Take the forecast data from DataHub for a single time and combine with unit information in each timestep. :parameter forecast: Forecast data from DataHub :parameter parameters: Unit information from DataHub :type forecast: dict :type parameters:dict :return: Individual forecast timestep :rtype: dict """ timestep = {} for element, value in forecast.items(): if element == "time": # Need to parse format like 2024-02-17T15:00Z. This can only be # done with datetime.datetime.fromisoformat from python 3.11 # onwards. timestep["time"] = datetime.datetime.strptime( forecast["time"], "%Y-%m-%dT%H:%M%z" ) elif ( element in ( "significantWeatherCode", "daySignificantWeatherCode", "nightSignificantWeatherCode", ) ) and self.convert_weather_code: timestep[element] = { "value": WEATHER_CODES[str(value)], "description": parameters[element]["description"], "unit_name": parameters[element]["unit"]["label"], "unit_symbol": parameters[element]["unit"]["symbol"]["type"], } else: timestep[element] = { "value": value, "description": parameters[element]["description"], "unit_name": parameters[element]["unit"]["label"], "unit_symbol": parameters[element]["unit"]["symbol"]["type"], } return timestep def _check_requested_time(self, target): """Check that a forecast for the requested time can be provided :parameter target: The requested time for the forecast :type target: datetime """ # Check that there is a forecast for the requested time. # If we have an hourly forecast, check that the requested time is at # most 30 minutes before the first datetime we have a forecast for. if self.frequency == "hourly" and target < self.timesteps[0][ "time" ] - datetime.timedelta(hours=0, minutes=30): err_str = ( "There is no forecast available for the requested time. " "The requested time is more than 30 minutes before the " "first available forecast." ) raise APIException(err_str) # If we have a three-hourly forecast, check that the requested time is at # most 1.5 hours before the first datetime we have a forecast for. if self.frequency == "three-hourly" and target < self.timesteps[0][ "time" ] - datetime.timedelta(hours=1, minutes=30): err_str = ( "There is no forecast available for the requested time. " "The requested time is more than 1 hour and 30 minutes " "before the first available forecast." ) raise APIException(err_str) # If we have a daily forecast, check that the requested time is at # most 6 hours before the first datetime we have a forecast for. if self.frequency == "daily" and target < self.timesteps[0][ "time" ] - datetime.timedelta(hours=6): err_str = ( "There is no forecast available for the requested time. " "The requested time is more than 6 hours before the first " "available forecast." ) raise APIException(err_str) # If we have a twice-daily forecast, check that the requested time is # at most 6 hours before the first datetime we have a forecast for. if self.frequency == "twice-daily" and target < self.timesteps[0][ "time" ] - datetime.timedelta(hours=6): err_str = ( "There is no forecast available for the requested time. " "The requested time is more than 6 hours before the first " "available forecast." ) raise APIException(err_str) # If we have an hourly forecast, check that the requested time is at # most 30 minutes after the final datetime we have a forecast for if self.frequency == "hourly" and target > ( self.timesteps[-1]["time"] + datetime.timedelta(hours=0, minutes=30) ): err_str = ( "There is no forecast available for the requested time. The " "requested time is more than 30 minutes after the first " "available forecast" ) raise APIException(err_str) # If we have a three-hourly forecast, then the target must be within 1.5 # hours of the last timestep if self.frequency == "three-hourly" and target > ( self.timesteps[-1]["time"] + datetime.timedelta(hours=1, minutes=30) ): err_str = ( "There is no forecast available for the requested time. The " "requested time is more than 1.5 hours after the first " "available forecast." ) raise APIException(err_str) # If we have a daily forecast, then the target must be within 6 hours # of the last timestep if self.frequency == "daily" and target > ( self.timesteps[-1]["time"] + datetime.timedelta(hours=6) ): err_str = ( "There is no forecast available for the requested time. The " "requested time is more than 6 hours after the first available " "forecast." ) raise APIException(err_str) # If we have a twice-daily forecast, then the target must be within 6 hours # of the last timestep if self.frequency == "twice-daily" and target > ( self.timesteps[-1]["time"] + datetime.timedelta(hours=6) ): err_str = ( "There is no forecast available for the requested time. The " "requested time is more than 6 hours after the first available " "forecast." ) raise APIException(err_str) def at_datetime(self, target): """Return the timestep closest to the target datetime :parameter target: Time to get the forecast for :type target: datetime :return: Individual forecast timestep :rtype: dict """ # Convert target to offset aware datetime if target.tzinfo is None: target = datetime.datetime.combine( target.date(), target.time(), self.timesteps[0]["time"].tzinfo ) self._check_requested_time(target) # Loop over all timesteps # Calculate the first time difference prev_td = target - self.timesteps[0]["time"] prev_ts = self.timesteps[0] to_return = None for i, timestep in enumerate(self.timesteps, start=1): # Calculate the difference between the target time and the # timestep. td = target - timestep["time"] # Find the timestep which is further from the target than the # previous one. Return the previous timestep if abs(td.total_seconds()) > abs(prev_td.total_seconds()): # We are further from the target to_return = prev_ts break if i == len(self.timesteps): to_return = timestep prev_ts = timestep prev_td = td return to_return def now(self): """Return the closest timestep to the current time :return: Individual forecast timestep :rtype: dict """ d = datetime.datetime.now(tz=self.timesteps[0]["time"].tzinfo) return self.at_datetime(d) def future(self, days=0, hours=0, minutes=0): """Return the closest timestep to a date in a given amount of time Either provide components of the time to the forecast or the total hours or minutes Providing components:: >>> import datapoint >>> m = datapoint.Manager(api_key = "blah") >>> f = m.get_forecast(latitude=50, longitude=0, frequency="hourly") >>> f.future(days=1, hours=2) Providing total hours:: >>> import datapoint >>> m = datapoint.Manager(api_key = "blah") >>> f = m.get_forecast(latitude=50, longitude=0, frequency="hourly") >>> f.future(hours=26) :parameter days: How many days ahead :parameter hours: How many hours ahead :parameter minutes: How many minutes ahead :type days: int :type hours: int :type minutes: int :return: Individual forecast timestep :rtype: dict """ d = datetime.datetime.now(tz=self.timesteps[0]["time"].tzinfo) target = d + datetime.timedelta(days=days, hours=hours, minutes=minutes) return self.at_datetime(target) datapoint-python-0.13.0/src/datapoint/Manager.py000066400000000000000000000200461474201672100216010ustar00rootroot00000000000000import geojson import requests from requests.adapters import HTTPAdapter from requests.packages.urllib3.util.retry import Retry from datapoint.exceptions import APIException from datapoint.Forecast import Forecast API_URL = "https://data.hub.api.metoffice.gov.uk/sitespecific/v0/point/" class Manager: """Manager for DataHub connection. Wraps calls to DataHub API, and provides Forecast objects. Basic Usage: :: >>> import datapoint >>> m = datapoint.Manager.Manager(api_key = "blah") >>> f = m.get_forecast( latitude=50, longitude=0, frequency="hourly", convert_weather_code=True ) >>> f.now() { 'time': datetime.datetime(2024, 2, 19, 13, 0, tzinfo=datetime.timezone.utc), 'screenTemperature': { 'value': 10.09, 'description': 'Screen Air Temperature', 'unit_name': 'degrees Celsius', 'unit_symbol': 'Cel' }, 'screenDewPointTemperature': { 'value': 8.08, 'description': 'Screen Dew Point Temperature', 'unit_name': 'degrees Celsius', 'unit_symbol': 'Cel' }, 'feelsLikeTemperature': { 'value': 6.85, 'description': 'Feels Like Temperature', 'unit_name': 'degrees Celsius', 'unit_symbol': 'Cel' }, 'windSpeed10m': { 'value': 7.57, 'description': '10m Wind Speed', 'unit_name': 'metres per second', 'unit_symbol': 'm/s' }, 'windDirectionFrom10m': { 'value': 263, 'description': '10m Wind From Direction', 'unit_name': 'degrees', 'unit_symbol': 'deg' }, 'windGustSpeed10m': { 'value': 12.31, 'description': '10m Wind Gust Speed', 'unit_name': 'metres per second', 'unit_symbol': 'm/s' }, 'visibility': { 'value': 21201, 'description': 'Visibility', 'unit_name': 'metres', 'unit_symbol': 'm' }, 'screenRelativeHumidity': { 'value': 87.81, 'description': 'Screen Relative Humidity', 'unit_name': 'percentage', 'unit_symbol': '%' }, 'mslp': { 'value': 103080, 'description': 'Mean Sea Level Pressure', 'unit_name': 'pascals', 'unit_symbol': 'Pa' }, 'uvIndex': { 'value': 1, 'description': 'UV Index', 'unit_name': 'dimensionless', 'unit_symbol': '1' }, 'significantWeatherCode': { 'value': 'Cloudy', 'description': 'Significant Weather Code', 'unit_name': 'dimensionless', 'unit_symbol': '1' }, 'precipitationRate': { 'value': 0.0, 'description': 'Precipitation Rate', 'unit_name': 'millimetres per hour', 'unit_symbol': 'mm/h' }, 'probOfPrecipitation': { 'value': 21, 'description': 'Probability of Precipitation', 'unit_name': 'percentage', 'unit_symbol': '%' } } """ def __init__(self, api_key=""): self.api_key = api_key def __get_retry_session( self, retries=10, backoff_factor=0.3, status_forcelist=(500, 502, 504), session=None, ): """ Retry the connection using requests if it fails. Use this as a wrapper to request from datapoint. See https://requests.readthedocs.io/en/latest/user/advanced/?highlight=retry#example-automatic-retries for more details. :parameter retries: How many times to retry :parameter backoff_factor: Backoff between attempts after second try :parameter status_forcelist: Codes to force a retry on :parameter session: Existing session to use :return: Session object :rtype: """ # requests.Session allows finer control, which is needed to use the # retrying code the_session = session or requests.Session() # The Retry object manages the actual retrying retry = Retry( total=retries, read=retries, connect=retries, backoff_factor=backoff_factor, status_forcelist=status_forcelist, ) adapter = HTTPAdapter(max_retries=retry) the_session.mount("http://", adapter) the_session.mount("https://", adapter) return the_session def __call_api(self, latitude, longitude, frequency): """ Call the datapoint api using the requests module :parameter latitude: Latitude of forecast location :parameter longitude: Longitude of forecast location :parameter frequency: Forecast frequency. One of 'hourly', 'three-hourly, 'daily' :type latitude: float :type longitude: float :type frequency: string :return: Data from DataPoint :rtype: dict """ params = { "latitude": latitude, "longitude": longitude, "includeLocationName": True, "excludeParameterMetadata": False, } headers = { "accept": "application/json", "apikey": self.api_key, } if frequency == "twice-daily": request_url = API_URL + "daily" else: request_url = API_URL + frequency # Add a timeout to the request. # The value of 1 second is based on attempting 100 connections to # datapoint and taking ten times the mean connection time (rounded up). # Could expose to users in the functions which need to call the api. # req = requests.get(url, params=payload, timeout=1) # The wrapper function __retry_session returns a requests.Session # object. This has a .get() function like requests.get(), so the use # doesn't change here. sess = self.__get_retry_session() req = sess.get( request_url, params=params, headers=headers, timeout=1, ) req.raise_for_status() try: data = geojson.loads(req.text) except ValueError as exc: raise APIException("DataPoint has not returned valid JSON") from exc return data def get_forecast( self, latitude, longitude, frequency="daily", convert_weather_code=True ): """ Get a forecast for the provided site. Three frequencies are supported by DataHub: hourly, three-hourly and daily. The 'twice-daily' option is for convenience and splits a daily forecast into two steps, one for day and one for night. :parameter latitude: Latitude of forecast location :parameter longitude: Longitude of forecast location :parameter frequency: Forecast frequency. One of 'hourly', 'three-hourly,'twice-daily', 'daily' :parameter convert_weather_code: Convert numeric weather codes to string description :type latitude: float :type longitude: float :type frequency: string :type convert_weather_code: bool :return: :class: `Forecast ` object :rtype: datapoint.Forecast """ if frequency not in ["hourly", "three-hourly", "twice-daily", "daily"]: raise ValueError( "frequency must be set to one of 'hourly', 'three-hourly', " "'twice-daily', 'daily'" ) data = self.__call_api(latitude, longitude, frequency) forecast = Forecast( frequency=frequency, api_data=data, convert_weather_code=convert_weather_code, ) return forecast datapoint-python-0.13.0/src/datapoint/__init__.py000066400000000000000000000000001474201672100217520ustar00rootroot00000000000000datapoint-python-0.13.0/src/datapoint/exceptions.py000066400000000000000000000001411474201672100224020ustar00rootroot00000000000000class APIException(Exception): """When Datapoint returns a broken API response.""" pass datapoint-python-0.13.0/src/datapoint/weather_codes.py000066400000000000000000000015671474201672100230520ustar00rootroot00000000000000# See https://datahub.metoffice.gov.uk/support/faqs for definitions WEATHER_CODES = { "NA": "Not available", "0": "Clear night", "1": "Sunny day", "2": "Partly cloudy", "3": "Partly cloudy", "4": "Not used", "5": "Mist", "6": "Fog", "7": "Cloudy", "8": "Overcast", "9": "Light rain shower", "10": "Light rain shower", "11": "Drizzle", "12": "Light rain", "13": "Heavy rain shower", "14": "Heavy rain shower", "15": "Heavy rain", "16": "Sleet shower", "17": "Sleet shower", "18": "Sleet", "19": "Hail shower", "20": "Hail shower", "21": "Hail", "22": "Light snow shower", "23": "Light snow shower", "24": "Light snow", "25": "Heavy snow shower", "26": "Heavy snow shower", "27": "Heavy snow", "28": "Thunder shower", "29": "Thunder shower", "30": "Thunder", } datapoint-python-0.13.0/tests/000077500000000000000000000000001474201672100162435ustar00rootroot00000000000000datapoint-python-0.13.0/tests/__init__.py000066400000000000000000000000001474201672100203420ustar00rootroot00000000000000datapoint-python-0.13.0/tests/integration/000077500000000000000000000000001474201672100205665ustar00rootroot00000000000000datapoint-python-0.13.0/tests/integration/test_manager.py000066400000000000000000000152751474201672100236230ustar00rootroot00000000000000import pytest import requests import tests.reference_data.reference_data_test_forecast as reference_data_test_forecast from datapoint.Manager import Manager class MockResponseHourly: def __init__(self): with open("./tests/reference_data/hourly_api_data.json") as f: my_json = f.read() self.text = my_json @staticmethod def raise_for_status(): pass @pytest.fixture def _mock_response_hourly(monkeypatch): def mock_get(*args, **kwargs): return MockResponseHourly() monkeypatch.setattr(requests.Session, "get", mock_get) @pytest.fixture def hourly_forecast(_mock_response_hourly): m = Manager(api_key="aaaaaaaaaaaaaaaaaaaaaaaaa") f = m.get_forecast(50.9992, 0.0154, frequency="hourly", convert_weather_code=True) return f @pytest.fixture def expected_first_hourly_timestep(): return reference_data_test_forecast.EXPECTED_FIRST_HOURLY_TIMESTEP class MockResponseThreeHourly: def __init__(self): with open("./tests/reference_data/three_hourly_api_data.json") as f: my_json = f.read() self.text = my_json @staticmethod def raise_for_status(): pass @pytest.fixture def _mock_response_three_hourly(monkeypatch): def mock_get(*args, **kwargs): return MockResponseThreeHourly() monkeypatch.setattr(requests.Session, "get", mock_get) @pytest.fixture def three_hourly_forecast(_mock_response_three_hourly): m = Manager(api_key="aaaaaaaaaaaaaaaaaaaaaaaaa") f = m.get_forecast( 50.9992, 0.0154, frequency="three-hourly", convert_weather_code=True ) return f @pytest.fixture def expected_first_three_hourly_timestep(): return reference_data_test_forecast.EXPECTED_FIRST_THREE_HOURLY_TIMESTEP class MockResponseDaily: def __init__(self): with open("./tests/reference_data/daily_api_data.json") as f: my_json = f.read() self.text = my_json @staticmethod def raise_for_status(): pass @pytest.fixture def _mock_response_daily(monkeypatch): def mock_get(*args, **kwargs): return MockResponseDaily() monkeypatch.setattr(requests.Session, "get", mock_get) @pytest.fixture def daily_forecast(_mock_response_daily): m = Manager(api_key="aaaaaaaaaaaaaaaaaaaaaaaaa") f = m.get_forecast(50.9992, 0.0154, frequency="daily", convert_weather_code=True) return f @pytest.fixture def twice_daily_forecast(_mock_response_daily): m = Manager(api_key="aaaaaaaaaaaaaaaaaaaaaaaaa") f = m.get_forecast( 50.9992, 0.0154, frequency="twice-daily", convert_weather_code=True ) return f @pytest.fixture def expected_first_daily_timestep(): return reference_data_test_forecast.EXPECTED_FIRST_DAILY_TIMESTEP @pytest.fixture def expected_first_twice_daily_timestep(): return reference_data_test_forecast.EXPECTED_FIRST_TWICE_DAILY_TIMESTEP class TestHourly: def test_location_name(self, hourly_forecast): assert hourly_forecast.name == "Sheffield Park" def test_forecast_frequency(self, hourly_forecast): assert hourly_forecast.frequency == "hourly" def test_forecast_location_latitude(self, hourly_forecast): assert hourly_forecast.forecast_latitude == 50.9992 def test_forecast_location_longitude(self, hourly_forecast): assert hourly_forecast.forecast_longitude == 0.0154 def test_forecast_distance_from_request(self, hourly_forecast): assert hourly_forecast.distance_from_requested_location == 1081.5349 def test_forecast_elevation(self, hourly_forecast): assert hourly_forecast.elevation == 37.0 def test_forecast_first_timestep( self, hourly_forecast, expected_first_hourly_timestep ): assert hourly_forecast.timesteps[0] == expected_first_hourly_timestep class TestThreeHourly: def test_forecast_frequency(self, three_hourly_forecast): assert three_hourly_forecast.frequency == "three-hourly" def test_forecast_location_name(self, three_hourly_forecast): assert three_hourly_forecast.name == "Sheffield Park" def test_forecast_location_latitude(self, three_hourly_forecast): assert three_hourly_forecast.forecast_latitude == 50.9992 def test_forecast_location_longitude(self, three_hourly_forecast): assert three_hourly_forecast.forecast_longitude == 0.0154 def test_forecast_distance_from_request(self, three_hourly_forecast): assert three_hourly_forecast.distance_from_requested_location == 1081.5349 def test_forecast_elevation(self, three_hourly_forecast): assert three_hourly_forecast.elevation == 37.0 def test_forecast_first_timestep( self, three_hourly_forecast, expected_first_three_hourly_timestep ): assert ( three_hourly_forecast.timesteps[0] == expected_first_three_hourly_timestep ) class TestDaily: def test_forecast_frequency(self, daily_forecast): assert daily_forecast.frequency == "daily" def test_forecast_location_name(self, daily_forecast): assert daily_forecast.name == "Sheffield Park" def test_forecast_location_latitude(self, daily_forecast): assert daily_forecast.forecast_latitude == 50.9992 def test_forecast_location_longitude(self, daily_forecast): assert daily_forecast.forecast_longitude == 0.0154 def test_forecast_distance_from_request(self, daily_forecast): assert daily_forecast.distance_from_requested_location == 1081.5349 def test_forecast_elevation(self, daily_forecast): assert daily_forecast.elevation == 37.0 def test_forecast_first_timestep( self, daily_forecast, expected_first_daily_timestep ): assert daily_forecast.timesteps[0] == expected_first_daily_timestep class TestTwiceDaily: def test_forecast_frequency(self, twice_daily_forecast): assert twice_daily_forecast.frequency == "twice-daily" def test_forecast_location_name(self, twice_daily_forecast): assert twice_daily_forecast.name == "Sheffield Park" def test_forecast_location_latitude(self, twice_daily_forecast): assert twice_daily_forecast.forecast_latitude == 50.9992 def test_forecast_location_longitude(self, twice_daily_forecast): assert twice_daily_forecast.forecast_longitude == 0.0154 def test_forecast_distance_from_request(self, twice_daily_forecast): assert twice_daily_forecast.distance_from_requested_location == 1081.5349 def test_forecast_elevation(self, twice_daily_forecast): assert twice_daily_forecast.elevation == 37.0 def test_forecast_first_timestep( self, twice_daily_forecast, expected_first_twice_daily_timestep ): assert twice_daily_forecast.timesteps[0] == expected_first_twice_daily_timestep datapoint-python-0.13.0/tests/reference_data/000077500000000000000000000000001474201672100211725ustar00rootroot00000000000000datapoint-python-0.13.0/tests/reference_data/__init__.py000066400000000000000000000000001474201672100232710ustar00rootroot00000000000000datapoint-python-0.13.0/tests/reference_data/daily_api_data.json000066400000000000000000000753641474201672100250300ustar00rootroot00000000000000{ "type": "FeatureCollection", "parameters": [{ "daySignificantWeatherCode": { "type": "Parameter", "description": "Day Significant Weather Code", "unit": { "label": "dimensionless", "symbol": { "value": "https://metoffice.apiconnect.ibmcloud.com/metoffice/production/", "type": "1" } } }, "midnightRelativeHumidity": { "type": "Parameter", "description": "Relative Humidity at Local Midnight", "unit": { "label": "percentage", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "%" } } }, "nightProbabilityOfHeavyRain": { "type": "Parameter", "description": "Probability of Heavy Rain During The Night", "unit": { "label": "percentage", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "%" } } }, "midnight10MWindSpeed": { "type": "Parameter", "description": "10m Wind Speed at Local Midnight", "unit": { "label": "metres per second", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "m/s" } } }, "nightUpperBoundMinFeelsLikeTemp": { "type": "Parameter", "description": "Upper Bound on Night Minimum Feels Like Air Temperature", "unit": { "label": "degrees Celsius", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "Cel" } } }, "nightUpperBoundMinTemp": { "type": "Parameter", "description": "Upper Bound on Night Minimum Screen Air Temperature", "unit": { "label": "degrees Celsius", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "Cel" } } }, "midnightVisibility": { "type": "Parameter", "description": "Visibility at Local Midnight", "unit": { "label": "metres", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "m" } } }, "dayUpperBoundMaxFeelsLikeTemp": { "type": "Parameter", "description": "Upper Bound on Day Maximum Feels Like Air Temperature", "unit": { "label": "degrees Celsius", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "Cel" } } }, "nightProbabilityOfRain": { "type": "Parameter", "description": "Probability of Rain During The Night", "unit": { "label": "percentage", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "%" } } }, "midday10MWindDirection": { "type": "Parameter", "description": "10m Wind Direction at Local Midday", "unit": { "label": "degrees", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "deg" } } }, "nightLowerBoundMinFeelsLikeTemp": { "type": "Parameter", "description": "Lower Bound on Night Minimum Feels Like Air Temperature", "unit": { "label": "degrees Celsius", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "Cel" } } }, "nightProbabilityOfHail": { "type": "Parameter", "description": "Probability of Hail During The Night", "unit": { "label": "percentage", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "%" } } }, "middayMslp": { "type": "Parameter", "description": "Mean Sea Level Pressure at Local Midday", "unit": { "label": "pascals", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "Pa" } } }, "dayProbabilityOfHeavySnow": { "type": "Parameter", "description": "Probability of Heavy Snow During The Day", "unit": { "label": "percentage", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "%" } } }, "nightProbabilityOfPrecipitation": { "type": "Parameter", "description": "Probability of Precipitation During The Night", "unit": { "label": "percentage", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "%" } } }, "dayProbabilityOfHail": { "type": "Parameter", "description": "Probability of Hail During The Day", "unit": { "label": "percentage", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "%" } } }, "dayProbabilityOfRain": { "type": "Parameter", "description": "Probability of Rain During The Day", "unit": { "label": "percentage", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "%" } } }, "midday10MWindSpeed": { "type": "Parameter", "description": "10m Wind Speed at Local Midday", "unit": { "label": "metres per second", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "m/s" } } }, "midday10MWindGust": { "type": "Parameter", "description": "10m Wind Gust Speed at Local Midday", "unit": { "label": "metres per second", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "m/s" } } }, "middayVisibility": { "type": "Parameter", "description": "Visibility at Local Midday", "unit": { "label": "metres", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "m" } } }, "midnight10MWindGust": { "type": "Parameter", "description": "10m Wind Gust Speed at Local Midnight", "unit": { "label": "metres per second", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "m/s" } } }, "midnightMslp": { "type": "Parameter", "description": "Mean Sea Level Pressure at Local Midnight", "unit": { "label": "pascals", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "Pa" } } }, "dayProbabilityOfSferics": { "type": "Parameter", "description": "Probability of Sferics During The Day", "unit": { "label": "percentage", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "%" } } }, "nightSignificantWeatherCode": { "type": "Parameter", "description": "Night Significant Weather Code", "unit": { "label": "dimensionless", "symbol": { "value": "https://metoffice.apiconnect.ibmcloud.com/metoffice/production/", "type": "1" } } }, "dayProbabilityOfPrecipitation": { "type": "Parameter", "description": "Probability of Precipitation During The Day", "unit": { "label": "percentage", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "%" } } }, "dayProbabilityOfHeavyRain": { "type": "Parameter", "description": "Probability of Heavy Rain During The Day", "unit": { "label": "percentage", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "%" } } }, "dayMaxScreenTemperature": { "type": "Parameter", "description": "Day Maximum Screen Air Temperature", "unit": { "label": "degrees Celsius", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "Cel" } } }, "nightMinScreenTemperature": { "type": "Parameter", "description": "Night Minimum Screen Air Temperature", "unit": { "label": "degrees Celsius", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "Cel" } } }, "midnight10MWindDirection": { "type": "Parameter", "description": "10m Wind Direction at Local Midnight", "unit": { "label": "degrees", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "deg" } } }, "maxUvIndex": { "type": "Parameter", "description": "Day Maximum UV Index", "unit": { "label": "dimensionless", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "1" } } }, "dayProbabilityOfSnow": { "type": "Parameter", "description": "Probability of Snow During The Day", "unit": { "label": "percentage", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "%" } } }, "nightProbabilityOfSnow": { "type": "Parameter", "description": "Probability of Snow During The Night", "unit": { "label": "percentage", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "%" } } }, "dayLowerBoundMaxTemp": { "type": "Parameter", "description": "Lower Bound on Day Maximum Screen Air Temperature", "unit": { "label": "degrees Celsius", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "Cel" } } }, "nightProbabilityOfHeavySnow": { "type": "Parameter", "description": "Probability of Heavy Snow During The Night", "unit": { "label": "percentage", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "%" } } }, "dayLowerBoundMaxFeelsLikeTemp": { "type": "Parameter", "description": "Lower Bound on Day Maximum Feels Like Air Temperature", "unit": { "label": "degrees Celsius", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "Cel" } } }, "dayUpperBoundMaxTemp": { "type": "Parameter", "description": "Upper Bound on Day Maximum Screen Air Temperature", "unit": { "label": "degrees Celsius", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "Cel" } } }, "dayMaxFeelsLikeTemp": { "type": "Parameter", "description": "Day Maximum Feels Like Air Temperature", "unit": { "label": "degrees Celsius", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "Cel" } } }, "middayRelativeHumidity": { "type": "Parameter", "description": "Relative Humidity at Local Midday", "unit": { "label": "percentage", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "%" } } }, "nightLowerBoundMinTemp": { "type": "Parameter", "description": "Lower Bound on Night Minimum Screen Air Temperature", "unit": { "label": "degrees Celsius", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "Cel" } } }, "nightMinFeelsLikeTemp": { "type": "Parameter", "description": "Night Minimum Feels Like Air Temperature", "unit": { "label": "degrees Celsius", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "Cel" } } }, "nightProbabilityOfSferics": { "type": "Parameter", "description": "Probability of Sferics During The Night", "unit": { "label": "percentage", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "%" } } } }], "features": [{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [0.0154, 50.9992, 37.0] }, "properties": { "location": { "name": "Sheffield Park" }, "requestPointDistance": 1081.5349, "modelRunDate": "2024-02-17T14:00Z", "timeSeries": [{ "time": "2024-02-16T00:00Z", "midday10MWindSpeed": 5.04, "midnight10MWindSpeed": 1.39, "midday10MWindDirection": 273, "midnight10MWindDirection": 243, "midday10MWindGust": 8.75, "midnight10MWindGust": 7.2, "middayVisibility": 28772, "midnightVisibility": 27712, "middayRelativeHumidity": 75.21, "midnightRelativeHumidity": 80.91, "middayMslp": 101680, "midnightMslp": 102640, "nightSignificantWeatherCode": 7, "dayMaxScreenTemperature": 12.82, "nightMinScreenTemperature": 5.32, "dayUpperBoundMaxTemp": 14.1, "nightUpperBoundMinTemp": 9.17, "dayLowerBoundMaxTemp": 11.97, "nightLowerBoundMinTemp": 3.56, "nightMinFeelsLikeTemp": 6.27, "dayUpperBoundMaxFeelsLikeTemp": 12.47, "nightUpperBoundMinFeelsLikeTemp": 8.74, "dayLowerBoundMaxFeelsLikeTemp": 10.01, "nightLowerBoundMinFeelsLikeTemp": 2.75, "nightProbabilityOfPrecipitation": 11, "nightProbabilityOfSnow": 0, "nightProbabilityOfHeavySnow": 0, "nightProbabilityOfRain": 10, "nightProbabilityOfHeavyRain": 0, "nightProbabilityOfHail": 0, "nightProbabilityOfSferics": 0 }, { "time": "2024-02-17T00:00Z", "midday10MWindSpeed": 4.32, "midnight10MWindSpeed": 6.1, "midday10MWindDirection": 230, "midnight10MWindDirection": 218, "midday10MWindGust": 8.75, "midnight10MWindGust": 12.98, "middayVisibility": 4158, "midnightVisibility": 5915, "middayRelativeHumidity": 97.38, "midnightRelativeHumidity": 93.62, "middayMslp": 103140, "midnightMslp": 102800, "maxUvIndex": 1, "daySignificantWeatherCode": 8, "nightSignificantWeatherCode": 15, "dayMaxScreenTemperature": 12.0, "nightMinScreenTemperature": 9.96, "dayUpperBoundMaxTemp": 13.71, "nightUpperBoundMinTemp": 10.71, "dayLowerBoundMaxTemp": 10.23, "nightLowerBoundMinTemp": 9.04, "dayMaxFeelsLikeTemp": 10.6, "nightMinFeelsLikeTemp": 7.76, "dayUpperBoundMaxFeelsLikeTemp": 11.49, "nightUpperBoundMinFeelsLikeTemp": 8.28, "dayLowerBoundMaxFeelsLikeTemp": 8.38, "nightLowerBoundMinFeelsLikeTemp": 7.04, "dayProbabilityOfPrecipitation": 18, "nightProbabilityOfPrecipitation": 97, "dayProbabilityOfSnow": 0, "nightProbabilityOfSnow": 0, "dayProbabilityOfHeavySnow": 0, "nightProbabilityOfHeavySnow": 0, "dayProbabilityOfRain": 18, "nightProbabilityOfRain": 97, "dayProbabilityOfHeavyRain": 5, "nightProbabilityOfHeavyRain": 96, "dayProbabilityOfHail": 0, "nightProbabilityOfHail": 20, "dayProbabilityOfSferics": 0, "nightProbabilityOfSferics": 10 }, { "time": "2024-02-18T00:00Z", "midday10MWindSpeed": 4.07, "midnight10MWindSpeed": 2.84, "midday10MWindDirection": 292, "midnight10MWindDirection": 281, "midday10MWindGust": 7.55, "midnight10MWindGust": 6.36, "middayVisibility": 25425, "midnightVisibility": 17183, "middayRelativeHumidity": 86.19, "midnightRelativeHumidity": 94.68, "middayMslp": 102625, "midnightMslp": 103041, "maxUvIndex": 1, "daySignificantWeatherCode": 12, "nightSignificantWeatherCode": 7, "dayMaxScreenTemperature": 13.89, "nightMinScreenTemperature": 7.15, "dayUpperBoundMaxTemp": 14.73, "nightUpperBoundMinTemp": 9.16, "dayLowerBoundMaxTemp": 12.4, "nightLowerBoundMinTemp": 5.31, "dayMaxFeelsLikeTemp": 11.75, "nightMinFeelsLikeTemp": 5.34, "dayUpperBoundMaxFeelsLikeTemp": 13.47, "nightUpperBoundMinFeelsLikeTemp": 7.12, "dayLowerBoundMaxFeelsLikeTemp": 10.8, "nightLowerBoundMinFeelsLikeTemp": 5.06, "dayProbabilityOfPrecipitation": 55, "nightProbabilityOfPrecipitation": 9, "dayProbabilityOfSnow": 0, "nightProbabilityOfSnow": 0, "dayProbabilityOfHeavySnow": 0, "nightProbabilityOfHeavySnow": 0, "dayProbabilityOfRain": 55, "nightProbabilityOfRain": 9, "dayProbabilityOfHeavyRain": 36, "nightProbabilityOfHeavyRain": 2, "dayProbabilityOfHail": 4, "nightProbabilityOfHail": 0, "dayProbabilityOfSferics": 3, "nightProbabilityOfSferics": 0 }, { "time": "2024-02-19T00:00Z", "midday10MWindSpeed": 5.47, "midnight10MWindSpeed": 2.59, "midday10MWindDirection": 276, "midnight10MWindDirection": 296, "midday10MWindGust": 10.47, "midnight10MWindGust": 4.49, "middayVisibility": 22511, "midnightVisibility": 23913, "middayRelativeHumidity": 82.45, "midnightRelativeHumidity": 89.64, "middayMslp": 102910, "midnightMslp": 103121, "maxUvIndex": 1, "daySignificantWeatherCode": 3, "nightSignificantWeatherCode": 7, "dayMaxScreenTemperature": 12.12, "nightMinScreenTemperature": 4.02, "dayUpperBoundMaxTemp": 13.27, "nightUpperBoundMinTemp": 8.61, "dayLowerBoundMaxTemp": 10.18, "nightLowerBoundMinTemp": 1.52, "dayMaxFeelsLikeTemp": 9.55, "nightMinFeelsLikeTemp": 2.36, "dayUpperBoundMaxFeelsLikeTemp": 11.33, "nightUpperBoundMinFeelsLikeTemp": 6.08, "dayLowerBoundMaxFeelsLikeTemp": 7.8, "nightLowerBoundMinFeelsLikeTemp": 1.06, "dayProbabilityOfPrecipitation": 49, "nightProbabilityOfPrecipitation": 5, "dayProbabilityOfSnow": 0, "nightProbabilityOfSnow": 1, "dayProbabilityOfHeavySnow": 0, "nightProbabilityOfHeavySnow": 0, "dayProbabilityOfRain": 49, "nightProbabilityOfRain": 5, "dayProbabilityOfHeavyRain": 30, "nightProbabilityOfHeavyRain": 0, "dayProbabilityOfHail": 3, "nightProbabilityOfHail": 0, "dayProbabilityOfSferics": 4, "nightProbabilityOfSferics": 0 }, { "time": "2024-02-20T00:00Z", "midday10MWindSpeed": 7.16, "midnight10MWindSpeed": 6.4, "midday10MWindDirection": 230, "midnight10MWindDirection": 232, "midday10MWindGust": 13.73, "midnight10MWindGust": 11.87, "middayVisibility": 24484, "midnightVisibility": 15050, "middayRelativeHumidity": 81.96, "midnightRelativeHumidity": 92.53, "middayMslp": 102756, "midnightMslp": 102018, "maxUvIndex": 1, "daySignificantWeatherCode": 7, "nightSignificantWeatherCode": 12, "dayMaxScreenTemperature": 10.71, "nightMinScreenTemperature": 8.75, "dayUpperBoundMaxTemp": 12.07, "nightUpperBoundMinTemp": 10.16, "dayLowerBoundMaxTemp": 9.37, "nightLowerBoundMinTemp": 5.87, "dayMaxFeelsLikeTemp": 7.33, "nightMinFeelsLikeTemp": 6.1, "dayUpperBoundMaxFeelsLikeTemp": 8.37, "nightUpperBoundMinFeelsLikeTemp": 7.54, "dayLowerBoundMaxFeelsLikeTemp": 6.38, "nightLowerBoundMinFeelsLikeTemp": 4.52, "dayProbabilityOfPrecipitation": 13, "nightProbabilityOfPrecipitation": 84, "dayProbabilityOfSnow": 0, "nightProbabilityOfSnow": 0, "dayProbabilityOfHeavySnow": 0, "nightProbabilityOfHeavySnow": 0, "dayProbabilityOfRain": 13, "nightProbabilityOfRain": 84, "dayProbabilityOfHeavyRain": 3, "nightProbabilityOfHeavyRain": 79, "dayProbabilityOfHail": 0, "nightProbabilityOfHail": 15, "dayProbabilityOfSferics": 0, "nightProbabilityOfSferics": 8 }, { "time": "2024-02-21T00:00Z", "midday10MWindSpeed": 8.38, "midnight10MWindSpeed": 6.06, "midday10MWindDirection": 206, "midnight10MWindDirection": 228, "midday10MWindGust": 15.83, "midnight10MWindGust": 11.11, "middayVisibility": 7351, "midnightVisibility": 11329, "middayRelativeHumidity": 90.56, "midnightRelativeHumidity": 93.31, "middayMslp": 100933, "midnightMslp": 99967, "maxUvIndex": 1, "daySignificantWeatherCode": 15, "nightSignificantWeatherCode": 12, "dayMaxScreenTemperature": 10.79, "nightMinScreenTemperature": 8.58, "dayUpperBoundMaxTemp": 13.6, "nightUpperBoundMinTemp": 11.01, "dayLowerBoundMaxTemp": 9.05, "nightLowerBoundMinTemp": 4.97, "dayMaxFeelsLikeTemp": 6.95, "nightMinFeelsLikeTemp": 6.72, "dayUpperBoundMaxFeelsLikeTemp": 10.54, "nightUpperBoundMinFeelsLikeTemp": 7.88, "dayLowerBoundMaxFeelsLikeTemp": 5.69, "nightLowerBoundMinFeelsLikeTemp": 1.79, "dayProbabilityOfPrecipitation": 86, "nightProbabilityOfPrecipitation": 78, "dayProbabilityOfSnow": 0, "nightProbabilityOfSnow": 0, "dayProbabilityOfHeavySnow": 0, "nightProbabilityOfHeavySnow": 0, "dayProbabilityOfRain": 86, "nightProbabilityOfRain": 78, "dayProbabilityOfHeavyRain": 82, "nightProbabilityOfHeavyRain": 73, "dayProbabilityOfHail": 16, "nightProbabilityOfHail": 14, "dayProbabilityOfSferics": 8, "nightProbabilityOfSferics": 7 }, { "time": "2024-02-22T00:00Z", "midday10MWindSpeed": 8.32, "midnight10MWindSpeed": 6.61, "midday10MWindDirection": 215, "midnight10MWindDirection": 245, "midday10MWindGust": 15.92, "midnight10MWindGust": 11.58, "middayVisibility": 13595, "midnightVisibility": 25279, "middayRelativeHumidity": 87.24, "midnightRelativeHumidity": 77.46, "middayMslp": 98762, "midnightMslp": 98742, "maxUvIndex": 1, "daySignificantWeatherCode": 14, "nightSignificantWeatherCode": 2, "dayMaxScreenTemperature": 10.99, "nightMinScreenTemperature": 4.47, "dayUpperBoundMaxTemp": 12.73, "nightUpperBoundMinTemp": 6.6, "dayLowerBoundMaxTemp": 8.4, "nightLowerBoundMinTemp": 2.22, "dayMaxFeelsLikeTemp": 6.86, "nightMinFeelsLikeTemp": 1.2, "dayUpperBoundMaxFeelsLikeTemp": 9.46, "nightUpperBoundMinFeelsLikeTemp": 2.54, "dayLowerBoundMaxFeelsLikeTemp": 5.2, "nightLowerBoundMinFeelsLikeTemp": -0.95, "dayProbabilityOfPrecipitation": 71, "nightProbabilityOfPrecipitation": 44, "dayProbabilityOfSnow": 0, "nightProbabilityOfSnow": 1, "dayProbabilityOfHeavySnow": 0, "nightProbabilityOfHeavySnow": 0, "dayProbabilityOfRain": 71, "nightProbabilityOfRain": 44, "dayProbabilityOfHeavyRain": 67, "nightProbabilityOfHeavyRain": 32, "dayProbabilityOfHail": 13, "nightProbabilityOfHail": 4, "dayProbabilityOfSferics": 12, "nightProbabilityOfSferics": 6 }, { "time": "2024-02-23T00:00Z", "midday10MWindSpeed": 7.11, "midnight10MWindSpeed": 4.2, "midday10MWindDirection": 231, "midnight10MWindDirection": 232, "midday10MWindGust": 13.38, "midnight10MWindGust": 7.16, "middayVisibility": 23049, "midnightVisibility": 22325, "middayRelativeHumidity": 73.25, "midnightRelativeHumidity": 85.83, "middayMslp": 98974, "midnightMslp": 99364, "maxUvIndex": 2, "daySignificantWeatherCode": 10, "nightSignificantWeatherCode": 2, "dayMaxScreenTemperature": 8.57, "nightMinScreenTemperature": 3.1, "dayUpperBoundMaxTemp": 10.67, "nightUpperBoundMinTemp": 6.84, "dayLowerBoundMaxTemp": 6.67, "nightLowerBoundMinTemp": -0.72, "dayMaxFeelsLikeTemp": 4.42, "nightMinFeelsLikeTemp": 0.74, "dayUpperBoundMaxFeelsLikeTemp": 7.38, "nightUpperBoundMinFeelsLikeTemp": 4.01, "dayLowerBoundMaxFeelsLikeTemp": 3.89, "nightLowerBoundMinFeelsLikeTemp": -2.25, "dayProbabilityOfPrecipitation": 52, "nightProbabilityOfPrecipitation": 9, "dayProbabilityOfSnow": 0, "nightProbabilityOfSnow": 1, "dayProbabilityOfHeavySnow": 0, "nightProbabilityOfHeavySnow": 1, "dayProbabilityOfRain": 52, "nightProbabilityOfRain": 9, "dayProbabilityOfHeavyRain": 48, "nightProbabilityOfHeavyRain": 4, "dayProbabilityOfHail": 10, "nightProbabilityOfHail": 1, "dayProbabilityOfSferics": 11, "nightProbabilityOfSferics": 1 }] } }] } datapoint-python-0.13.0/tests/reference_data/hourly_api_data.json000066400000000000000000001321161474201672100252350ustar00rootroot00000000000000{ "type": "FeatureCollection", "parameters": [{ "totalSnowAmount": { "type": "Parameter", "description": "Total Snow Amount Over Previous Hour", "unit": { "label": "millimetres", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "mm" } } }, "screenTemperature": { "type": "Parameter", "description": "Screen Air Temperature", "unit": { "label": "degrees Celsius", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "Cel" } } }, "visibility": { "type": "Parameter", "description": "Visibility", "unit": { "label": "metres", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "m" } } }, "windDirectionFrom10m": { "type": "Parameter", "description": "10m Wind From Direction", "unit": { "label": "degrees", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "deg" } } }, "precipitationRate": { "type": "Parameter", "description": "Precipitation Rate", "unit": { "label": "millimetres per hour", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "mm/h" } } }, "maxScreenAirTemp": { "type": "Parameter", "description": "Maximum Screen Air Temperature Over Previous Hour", "unit": { "label": "degrees Celsius", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "Cel" } } }, "feelsLikeTemperature": { "type": "Parameter", "description": "Feels Like Temperature", "unit": { "label": "degrees Celsius", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "Cel" } } }, "screenDewPointTemperature": { "type": "Parameter", "description": "Screen Dew Point Temperature", "unit": { "label": "degrees Celsius", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "Cel" } } }, "screenRelativeHumidity": { "type": "Parameter", "description": "Screen Relative Humidity", "unit": { "label": "percentage", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "%" } } }, "windSpeed10m": { "type": "Parameter", "description": "10m Wind Speed", "unit": { "label": "metres per second", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "m/s" } } }, "probOfPrecipitation": { "type": "Parameter", "description": "Probability of Precipitation", "unit": { "label": "percentage", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "%" } } }, "max10mWindGust": { "type": "Parameter", "description": "Maximum 10m Wind Gust Speed Over Previous Hour", "unit": { "label": "metres per second", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "m/s" } } }, "significantWeatherCode": { "type": "Parameter", "description": "Significant Weather Code", "unit": { "label": "dimensionless", "symbol": { "value": "https://metoffice.apiconnect.ibmcloud.com/metoffice/production/", "type": "1" } } }, "minScreenAirTemp": { "type": "Parameter", "description": "Minimum Screen Air Temperature Over Previous Hour", "unit": { "label": "degrees Celsius", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "Cel" } } }, "totalPrecipAmount": { "type": "Parameter", "description": "Total Precipitation Amount Over Previous Hour", "unit": { "label": "millimetres", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "mm" } } }, "mslp": { "type": "Parameter", "description": "Mean Sea Level Pressure", "unit": { "label": "pascals", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "Pa" } } }, "windGustSpeed10m": { "type": "Parameter", "description": "10m Wind Gust Speed", "unit": { "label": "metres per second", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "m/s" } } }, "uvIndex": { "type": "Parameter", "description": "UV Index", "unit": { "label": "dimensionless", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "1" } } } }], "features": [{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [0.0154, 50.9992, 37.0] }, "properties": { "location": { "name": "Sheffield Park" }, "requestPointDistance": 1081.5349, "modelRunDate": "2024-02-15T19:00Z", "timeSeries": [{ "time": "2024-02-15T19:00Z", "screenTemperature": 11.0, "maxScreenAirTemp": 11.55, "minScreenAirTemp": 10.98, "screenDewPointTemperature": 8.94, "feelsLikeTemperature": 10.87, "windSpeed10m": 1.18, "windDirectionFrom10m": 180, "windGustSpeed10m": 6.69, "max10mWindGust": 8.92, "visibility": 19174, "screenRelativeHumidity": 86.99, "mslp": 100660, "uvIndex": 0, "significantWeatherCode": 2, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 4 }, { "time": "2024-02-15T20:00Z", "screenTemperature": 11.38, "maxScreenAirTemp": 11.38, "minScreenAirTemp": 11.0, "screenDewPointTemperature": 9.55, "feelsLikeTemperature": 10.96, "windSpeed10m": 1.68, "windDirectionFrom10m": 96, "windGustSpeed10m": 3.55, "max10mWindGust": 5.64, "visibility": 17279, "screenRelativeHumidity": 88.39, "mslp": 100653, "uvIndex": 0, "significantWeatherCode": 2, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 1 }, { "time": "2024-02-15T21:00Z", "screenTemperature": 11.49, "maxScreenAirTemp": 11.5, "minScreenAirTemp": 11.38, "screenDewPointTemperature": 9.97, "feelsLikeTemperature": 11.21, "windSpeed10m": 1.52, "windDirectionFrom10m": 79, "windGustSpeed10m": 3.34, "max10mWindGust": 5.42, "visibility": 14995, "screenRelativeHumidity": 90.31, "mslp": 100714, "uvIndex": 0, "significantWeatherCode": 7, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 4 }, { "time": "2024-02-15T22:00Z", "screenTemperature": 11.18, "maxScreenAirTemp": 11.49, "minScreenAirTemp": 11.13, "screenDewPointTemperature": 9.93, "feelsLikeTemperature": 10.47, "windSpeed10m": 2.05, "windDirectionFrom10m": 112, "windGustSpeed10m": 4.34, "max10mWindGust": 5.18, "visibility": 13525, "screenRelativeHumidity": 91.97, "mslp": 100668, "uvIndex": 0, "significantWeatherCode": 2, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 0 }, { "time": "2024-02-15T23:00Z", "screenTemperature": 10.84, "maxScreenAirTemp": 11.18, "minScreenAirTemp": 10.78, "screenDewPointTemperature": 9.7, "feelsLikeTemperature": 10.15, "windSpeed10m": 1.96, "windDirectionFrom10m": 108, "windGustSpeed10m": 4.74, "max10mWindGust": 5.33, "visibility": 12925, "screenRelativeHumidity": 92.64, "mslp": 100680, "uvIndex": 0, "significantWeatherCode": 2, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 1 }, { "time": "2024-02-16T00:00Z", "screenTemperature": 10.53, "maxScreenAirTemp": 10.84, "minScreenAirTemp": 10.52, "screenDewPointTemperature": 9.55, "feelsLikeTemperature": 10.1, "windSpeed10m": 1.47, "windDirectionFrom10m": 108, "windGustSpeed10m": 5.09, "max10mWindGust": 5.43, "visibility": 12220, "screenRelativeHumidity": 93.66, "mslp": 100650, "uvIndex": 0, "significantWeatherCode": 2, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 1 }, { "time": "2024-02-16T01:00Z", "screenTemperature": 10.72, "maxScreenAirTemp": 10.78, "minScreenAirTemp": 10.53, "screenDewPointTemperature": 9.62, "feelsLikeTemperature": 10.31, "windSpeed10m": 1.48, "windDirectionFrom10m": 135, "windGustSpeed10m": 5.05, "max10mWindGust": 5.65, "visibility": 14094, "screenRelativeHumidity": 92.91, "mslp": 100660, "uvIndex": 0, "significantWeatherCode": 7, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 5 }, { "time": "2024-02-16T02:00Z", "screenTemperature": 10.73, "maxScreenAirTemp": 10.82, "minScreenAirTemp": 10.65, "screenDewPointTemperature": 9.75, "feelsLikeTemperature": 10.51, "windSpeed10m": 1.17, "windDirectionFrom10m": 185, "windGustSpeed10m": 5.33, "max10mWindGust": 5.73, "visibility": 13709, "screenRelativeHumidity": 93.64, "mslp": 100688, "uvIndex": 0, "significantWeatherCode": 2, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 2 }, { "time": "2024-02-16T03:00Z", "screenTemperature": 10.93, "maxScreenAirTemp": 10.94, "minScreenAirTemp": 10.73, "screenDewPointTemperature": 9.92, "feelsLikeTemperature": 10.38, "windSpeed10m": 1.61, "windDirectionFrom10m": 240, "windGustSpeed10m": 5.97, "max10mWindGust": 6.16, "visibility": 13864, "screenRelativeHumidity": 93.55, "mslp": 100744, "uvIndex": 0, "significantWeatherCode": 7, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 6 }, { "time": "2024-02-16T04:00Z", "screenTemperature": 11.03, "maxScreenAirTemp": 11.05, "minScreenAirTemp": 10.93, "screenDewPointTemperature": 10.21, "feelsLikeTemperature": 9.95, "windSpeed10m": 2.59, "windDirectionFrom10m": 279, "windGustSpeed10m": 7.23, "max10mWindGust": 7.35, "visibility": 11033, "screenRelativeHumidity": 94.71, "mslp": 100806, "uvIndex": 0, "significantWeatherCode": 8, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 13 }, { "time": "2024-02-16T05:00Z", "screenTemperature": 11.27, "maxScreenAirTemp": 11.28, "minScreenAirTemp": 11.03, "screenDewPointTemperature": 10.54, "feelsLikeTemperature": 9.74, "windSpeed10m": 3.47, "windDirectionFrom10m": 288, "windGustSpeed10m": 8.23, "max10mWindGust": 8.45, "visibility": 14201, "screenRelativeHumidity": 95.25, "mslp": 100909, "uvIndex": 0, "significantWeatherCode": 12, "precipitationRate": 0.23, "totalPrecipAmount": 0.08, "totalSnowAmount": 0, "probOfPrecipitation": 43 }, { "time": "2024-02-16T06:00Z", "screenTemperature": 10.92, "maxScreenAirTemp": 11.13, "minScreenAirTemp": 10.9, "screenDewPointTemperature": 10.04, "feelsLikeTemperature": 9.49, "windSpeed10m": 3.18, "windDirectionFrom10m": 283, "windGustSpeed10m": 7.71, "max10mWindGust": 8.27, "visibility": 25090, "screenRelativeHumidity": 94.41, "mslp": 101042, "uvIndex": 0, "significantWeatherCode": 7, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 7 }, { "time": "2024-02-16T07:00Z", "screenTemperature": 10.62, "maxScreenAirTemp": 10.92, "minScreenAirTemp": 10.61, "screenDewPointTemperature": 9.43, "feelsLikeTemperature": 8.87, "windSpeed10m": 3.68, "windDirectionFrom10m": 279, "windGustSpeed10m": 8.1, "max10mWindGust": 8.55, "visibility": 21863, "screenRelativeHumidity": 92.4, "mslp": 101186, "uvIndex": 0, "significantWeatherCode": 7, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 7 }, { "time": "2024-02-16T08:00Z", "screenTemperature": 10.3, "maxScreenAirTemp": 10.62, "minScreenAirTemp": 10.27, "screenDewPointTemperature": 8.77, "feelsLikeTemperature": 8.27, "windSpeed10m": 4.15, "windDirectionFrom10m": 278, "windGustSpeed10m": 8.77, "max10mWindGust": 8.86, "visibility": 17499, "screenRelativeHumidity": 90.34, "mslp": 101326, "uvIndex": 1, "significantWeatherCode": 3, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 1 }, { "time": "2024-02-16T09:00Z", "screenTemperature": 10.46, "maxScreenAirTemp": 10.47, "minScreenAirTemp": 10.3, "screenDewPointTemperature": 8.47, "feelsLikeTemperature": 8.26, "windSpeed10m": 4.59, "windDirectionFrom10m": 279, "windGustSpeed10m": 8.75, "max10mWindGust": 8.75, "visibility": 16833, "screenRelativeHumidity": 87.56, "mslp": 101456, "uvIndex": 1, "significantWeatherCode": 3, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 0 }, { "time": "2024-02-16T10:00Z", "screenTemperature": 11.07, "maxScreenAirTemp": 11.09, "minScreenAirTemp": 10.46, "screenDewPointTemperature": 8.27, "feelsLikeTemperature": 8.92, "windSpeed10m": 4.68, "windDirectionFrom10m": 276, "windGustSpeed10m": 8.7, "max10mWindGust": 8.7, "visibility": 20678, "screenRelativeHumidity": 82.98, "mslp": 101557, "uvIndex": 1, "significantWeatherCode": 3, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 0 }, { "time": "2024-02-16T11:00Z", "screenTemperature": 11.71, "maxScreenAirTemp": 11.74, "minScreenAirTemp": 11.07, "screenDewPointTemperature": 7.9, "feelsLikeTemperature": 9.42, "windSpeed10m": 5.16, "windDirectionFrom10m": 273, "windGustSpeed10m": 9.42, "max10mWindGust": 9.42, "visibility": 30259, "screenRelativeHumidity": 77.53, "mslp": 101647, "uvIndex": 1, "significantWeatherCode": 1, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 0 }, { "time": "2024-02-16T12:00Z", "screenTemperature": 12.37, "maxScreenAirTemp": 12.39, "minScreenAirTemp": 11.71, "screenDewPointTemperature": 7.67, "feelsLikeTemperature": 10.03, "windSpeed10m": 5.39, "windDirectionFrom10m": 275, "windGustSpeed10m": 9.94, "max10mWindGust": 9.94, "visibility": 34462, "screenRelativeHumidity": 73.05, "mslp": 101700, "uvIndex": 1, "significantWeatherCode": 3, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 0 }, { "time": "2024-02-16T13:00Z", "screenTemperature": 12.91, "maxScreenAirTemp": 12.94, "minScreenAirTemp": 12.37, "screenDewPointTemperature": 7.75, "feelsLikeTemperature": 10.76, "windSpeed10m": 4.97, "windDirectionFrom10m": 271, "windGustSpeed10m": 9.39, "max10mWindGust": 9.65, "visibility": 37584, "screenRelativeHumidity": 70.9, "mslp": 101750, "uvIndex": 1, "significantWeatherCode": 3, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 0 }, { "time": "2024-02-16T14:00Z", "screenTemperature": 12.9, "maxScreenAirTemp": 13.04, "minScreenAirTemp": 12.69, "screenDewPointTemperature": 7.06, "feelsLikeTemperature": 10.54, "windSpeed10m": 5.39, "windDirectionFrom10m": 270, "windGustSpeed10m": 10.16, "max10mWindGust": 10.16, "visibility": 38254, "screenRelativeHumidity": 67.76, "mslp": 101813, "uvIndex": 1, "significantWeatherCode": 3, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 1 }, { "time": "2024-02-16T15:00Z", "screenTemperature": 12.79, "maxScreenAirTemp": 12.9, "minScreenAirTemp": 12.72, "screenDewPointTemperature": 6.92, "feelsLikeTemperature": 10.69, "windSpeed10m": 4.78, "windDirectionFrom10m": 267, "windGustSpeed10m": 9.36, "max10mWindGust": 9.96, "visibility": 38521, "screenRelativeHumidity": 67.6, "mslp": 101887, "uvIndex": 1, "significantWeatherCode": 3, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 1 }, { "time": "2024-02-16T16:00Z", "screenTemperature": 12.06, "maxScreenAirTemp": 12.79, "minScreenAirTemp": 12.04, "screenDewPointTemperature": 6.8, "feelsLikeTemperature": 10.23, "windSpeed10m": 4.07, "windDirectionFrom10m": 266, "windGustSpeed10m": 8.66, "max10mWindGust": 9.27, "visibility": 37284, "screenRelativeHumidity": 70.37, "mslp": 101980, "uvIndex": 1, "significantWeatherCode": 1, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 0 }, { "time": "2024-02-16T17:00Z", "screenTemperature": 10.8, "maxScreenAirTemp": 12.06, "minScreenAirTemp": 10.77, "screenDewPointTemperature": 6.94, "feelsLikeTemperature": 9.36, "windSpeed10m": 3.16, "windDirectionFrom10m": 261, "windGustSpeed10m": 8.0, "max10mWindGust": 8.43, "visibility": 33668, "screenRelativeHumidity": 77.2, "mslp": 102066, "uvIndex": 1, "significantWeatherCode": 1, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 0 }, { "time": "2024-02-16T18:00Z", "screenTemperature": 9.6, "maxScreenAirTemp": 10.8, "minScreenAirTemp": 9.58, "screenDewPointTemperature": 6.7, "feelsLikeTemperature": 8.37, "windSpeed10m": 2.58, "windDirectionFrom10m": 257, "windGustSpeed10m": 7.4, "max10mWindGust": 8.52, "visibility": 29126, "screenRelativeHumidity": 82.34, "mslp": 102166, "uvIndex": 0, "significantWeatherCode": 0, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 0 }, { "time": "2024-02-16T19:00Z", "screenTemperature": 8.94, "maxScreenAirTemp": 9.6, "minScreenAirTemp": 8.9, "screenDewPointTemperature": 6.8, "feelsLikeTemperature": 7.68, "windSpeed10m": 2.46, "windDirectionFrom10m": 255, "windGustSpeed10m": 7.35, "max10mWindGust": 8.02, "visibility": 22767, "screenRelativeHumidity": 86.81, "mslp": 102246, "uvIndex": 0, "significantWeatherCode": 0, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 0 }, { "time": "2024-02-16T20:00Z", "screenTemperature": 8.42, "maxScreenAirTemp": 8.94, "minScreenAirTemp": 8.41, "screenDewPointTemperature": 6.3, "feelsLikeTemperature": 7.06, "windSpeed10m": 2.45, "windDirectionFrom10m": 263, "windGustSpeed10m": 7.47, "max10mWindGust": 7.99, "visibility": 21802, "screenRelativeHumidity": 86.73, "mslp": 102329, "uvIndex": 0, "significantWeatherCode": 0, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 0 }, { "time": "2024-02-16T21:00Z", "screenTemperature": 7.87, "maxScreenAirTemp": 8.42, "minScreenAirTemp": 7.86, "screenDewPointTemperature": 6.11, "feelsLikeTemperature": 6.51, "windSpeed10m": 2.33, "windDirectionFrom10m": 267, "windGustSpeed10m": 7.0, "max10mWindGust": 7.86, "visibility": 21303, "screenRelativeHumidity": 88.8, "mslp": 102406, "uvIndex": 0, "significantWeatherCode": 0, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 0 }, { "time": "2024-02-16T22:00Z", "screenTemperature": 7.48, "maxScreenAirTemp": 7.87, "minScreenAirTemp": 7.46, "screenDewPointTemperature": 5.89, "feelsLikeTemperature": 6.06, "windSpeed10m": 2.32, "windDirectionFrom10m": 274, "windGustSpeed10m": 6.96, "max10mWindGust": 7.77, "visibility": 20523, "screenRelativeHumidity": 89.86, "mslp": 102479, "uvIndex": 0, "significantWeatherCode": 0, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 1 }, { "time": "2024-02-16T23:00Z", "screenTemperature": 7.04, "maxScreenAirTemp": 7.48, "minScreenAirTemp": 7.01, "screenDewPointTemperature": 5.66, "feelsLikeTemperature": 5.68, "windSpeed10m": 2.18, "windDirectionFrom10m": 280, "windGustSpeed10m": 6.69, "max10mWindGust": 7.53, "visibility": 20867, "screenRelativeHumidity": 91.09, "mslp": 102545, "uvIndex": 0, "significantWeatherCode": 0, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 1 }, { "time": "2024-02-17T00:00Z", "screenTemperature": 6.7, "maxScreenAirTemp": 7.04, "minScreenAirTemp": 6.67, "screenDewPointTemperature": 5.59, "feelsLikeTemperature": 5.32, "windSpeed10m": 2.11, "windDirectionFrom10m": 281, "windGustSpeed10m": 6.34, "max10mWindGust": 7.01, "visibility": 20045, "screenRelativeHumidity": 92.83, "mslp": 102614, "uvIndex": 0, "significantWeatherCode": 0, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 1 }, { "time": "2024-02-17T01:00Z", "screenTemperature": 6.26, "maxScreenAirTemp": 6.7, "minScreenAirTemp": 6.21, "screenDewPointTemperature": 5.34, "feelsLikeTemperature": 4.85, "windSpeed10m": 2.05, "windDirectionFrom10m": 283, "windGustSpeed10m": 6.13, "max10mWindGust": 6.88, "visibility": 18378, "screenRelativeHumidity": 94.11, "mslp": 102657, "uvIndex": 0, "significantWeatherCode": 0, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 1 }, { "time": "2024-02-17T02:00Z", "screenTemperature": 5.72, "maxScreenAirTemp": 6.26, "minScreenAirTemp": 5.66, "screenDewPointTemperature": 5.02, "feelsLikeTemperature": 4.45, "windSpeed10m": 1.73, "windDirectionFrom10m": 282, "windGustSpeed10m": 5.73, "max10mWindGust": 6.69, "visibility": 14463, "screenRelativeHumidity": 95.57, "mslp": 102697, "uvIndex": 0, "significantWeatherCode": 0, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 2 }, { "time": "2024-02-17T03:00Z", "screenTemperature": 5.22, "maxScreenAirTemp": 5.72, "minScreenAirTemp": 5.17, "screenDewPointTemperature": 4.68, "feelsLikeTemperature": 4.03, "windSpeed10m": 1.37, "windDirectionFrom10m": 267, "windGustSpeed10m": 5.08, "max10mWindGust": 6.2, "visibility": 12881, "screenRelativeHumidity": 96.48, "mslp": 102729, "uvIndex": 0, "significantWeatherCode": 0, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 3 }, { "time": "2024-02-17T04:00Z", "screenTemperature": 5.44, "maxScreenAirTemp": 5.46, "minScreenAirTemp": 5.22, "screenDewPointTemperature": 4.9, "feelsLikeTemperature": 4.28, "windSpeed10m": 1.22, "windDirectionFrom10m": 234, "windGustSpeed10m": 4.72, "max10mWindGust": 5.38, "visibility": 13816, "screenRelativeHumidity": 96.53, "mslp": 102767, "uvIndex": 0, "significantWeatherCode": 2, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 2 }, { "time": "2024-02-17T05:00Z", "screenTemperature": 5.67, "maxScreenAirTemp": 5.73, "minScreenAirTemp": 5.44, "screenDewPointTemperature": 5.3, "feelsLikeTemperature": 4.55, "windSpeed10m": 1.28, "windDirectionFrom10m": 182, "windGustSpeed10m": 3.99, "max10mWindGust": 4.95, "visibility": 4000, "screenRelativeHumidity": 97.73, "mslp": 102819, "uvIndex": 0, "significantWeatherCode": 7, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 5 }, { "time": "2024-02-17T06:00Z", "screenTemperature": 6.01, "maxScreenAirTemp": 6.24, "minScreenAirTemp": 5.67, "screenDewPointTemperature": 5.66, "feelsLikeTemperature": 4.95, "windSpeed10m": 1.51, "windDirectionFrom10m": 156, "windGustSpeed10m": 3.65, "max10mWindGust": 3.87, "visibility": 999, "screenRelativeHumidity": 97.85, "mslp": 102866, "uvIndex": 0, "significantWeatherCode": 6, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 17 }, { "time": "2024-02-17T07:00Z", "screenTemperature": 6.74, "maxScreenAirTemp": 6.75, "minScreenAirTemp": 6.01, "screenDewPointTemperature": 6.32, "feelsLikeTemperature": 5.73, "windSpeed10m": 1.63, "windDirectionFrom10m": 161, "windGustSpeed10m": 4.12, "max10mWindGust": 4.12, "visibility": 4213, "screenRelativeHumidity": 97.43, "mslp": 102918, "uvIndex": 0, "significantWeatherCode": 7, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 8 }, { "time": "2024-02-17T08:00Z", "screenTemperature": 7.5, "maxScreenAirTemp": 7.54, "minScreenAirTemp": 6.74, "screenDewPointTemperature": 7.09, "feelsLikeTemperature": 6.54, "windSpeed10m": 1.8, "windDirectionFrom10m": 171, "windGustSpeed10m": 4.56, "max10mWindGust": 4.56, "visibility": 5736, "screenRelativeHumidity": 97.44, "mslp": 102968, "uvIndex": 1, "significantWeatherCode": 7, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 14 }, { "time": "2024-02-17T09:00Z", "screenTemperature": 8.46, "maxScreenAirTemp": 8.48, "minScreenAirTemp": 7.5, "screenDewPointTemperature": 7.89, "feelsLikeTemperature": 7.54, "windSpeed10m": 1.9, "windDirectionFrom10m": 176, "windGustSpeed10m": 5.23, "max10mWindGust": 5.23, "visibility": 5476, "screenRelativeHumidity": 96.48, "mslp": 103015, "uvIndex": 1, "significantWeatherCode": 7, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 15 }, { "time": "2024-02-17T10:00Z", "screenTemperature": 9.31, "maxScreenAirTemp": 9.32, "minScreenAirTemp": 8.46, "screenDewPointTemperature": 8.71, "feelsLikeTemperature": 8.16, "windSpeed10m": 2.49, "windDirectionFrom10m": 194, "windGustSpeed10m": 5.87, "max10mWindGust": 6.19, "visibility": 5671, "screenRelativeHumidity": 96.3, "mslp": 103039, "uvIndex": 1, "significantWeatherCode": 8, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 13 }, { "time": "2024-02-17T11:00Z", "screenTemperature": 10.23, "maxScreenAirTemp": 10.23, "minScreenAirTemp": 9.31, "screenDewPointTemperature": 9.34, "feelsLikeTemperature": 8.78, "windSpeed10m": 3.08, "windDirectionFrom10m": 202, "windGustSpeed10m": 6.31, "max10mWindGust": 6.31, "visibility": 11241, "screenRelativeHumidity": 94.6, "mslp": 103069, "uvIndex": 1, "significantWeatherCode": 8, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 13 }, { "time": "2024-02-17T12:00Z", "screenTemperature": 10.79, "maxScreenAirTemp": 10.82, "minScreenAirTemp": 10.23, "screenDewPointTemperature": 9.48, "feelsLikeTemperature": 9.18, "windSpeed10m": 3.5, "windDirectionFrom10m": 203, "windGustSpeed10m": 6.77, "max10mWindGust": 6.77, "visibility": 13088, "screenRelativeHumidity": 92.01, "mslp": 103068, "uvIndex": 1, "significantWeatherCode": 8, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 13 }, { "time": "2024-02-17T13:00Z", "screenTemperature": 10.84, "maxScreenAirTemp": 10.84, "minScreenAirTemp": 10.79, "screenDewPointTemperature": 9.5, "feelsLikeTemperature": 9.17, "windSpeed10m": 3.63, "windDirectionFrom10m": 202, "windGustSpeed10m": 7.09, "max10mWindGust": 7.09, "visibility": 13756, "screenRelativeHumidity": 91.77, "mslp": 103050, "uvIndex": 1, "significantWeatherCode": 8, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 14 }, { "time": "2024-02-17T14:00Z", "screenTemperature": 10.63, "maxScreenAirTemp": 10.84, "minScreenAirTemp": 10.63, "screenDewPointTemperature": 9.58, "feelsLikeTemperature": 8.92, "windSpeed10m": 3.62, "windDirectionFrom10m": 201, "windGustSpeed10m": 7.07, "max10mWindGust": 7.07, "visibility": 12109, "screenRelativeHumidity": 93.68, "mslp": 103021, "uvIndex": 1, "significantWeatherCode": 8, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 14 }, { "time": "2024-02-17T15:00Z", "screenTemperature": 10.62, "maxScreenAirTemp": 10.73, "minScreenAirTemp": 10.6, "screenDewPointTemperature": 9.53, "feelsLikeTemperature": 8.92, "windSpeed10m": 3.61, "windDirectionFrom10m": 200, "windGustSpeed10m": 7.22, "max10mWindGust": 7.22, "visibility": 12463, "screenRelativeHumidity": 93.39, "mslp": 103003, "uvIndex": 1, "significantWeatherCode": 8, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 12 }, { "time": "2024-02-17T16:00Z", "screenTemperature": 10.57, "maxScreenAirTemp": 10.62, "minScreenAirTemp": 10.56, "screenDewPointTemperature": 9.47, "feelsLikeTemperature": 8.88, "windSpeed10m": 3.65, "windDirectionFrom10m": 197, "windGustSpeed10m": 7.38, "max10mWindGust": 7.38, "visibility": 12932, "screenRelativeHumidity": 93.29, "mslp": 102986, "uvIndex": 1, "significantWeatherCode": 8, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 12 }, { "time": "2024-02-17T17:00Z", "screenTemperature": 10.45, "maxScreenAirTemp": 10.57, "minScreenAirTemp": 10.44, "screenDewPointTemperature": 9.39, "feelsLikeTemperature": 8.75, "windSpeed10m": 3.67, "windDirectionFrom10m": 191, "windGustSpeed10m": 7.54, "max10mWindGust": 7.54, "visibility": 11295, "screenRelativeHumidity": 93.5, "mslp": 102968, "uvIndex": 1, "significantWeatherCode": 8, "precipitationRate": 0.0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "probOfPrecipitation": 14 }, { "time": "2024-02-17T18:00Z", "screenTemperature": 10.25, "screenDewPointTemperature": 9.3, "feelsLikeTemperature": 8.46, "windSpeed10m": 3.77, "windDirectionFrom10m": 182, "windGustSpeed10m": 7.94, "visibility": 10383, "screenRelativeHumidity": 94.28, "mslp": 102949, "uvIndex": 0, "significantWeatherCode": 7, "precipitationRate": 0.0, "probOfPrecipitation": 11 }, { "time": "2024-02-17T19:00Z", "screenTemperature": 10.34, "screenDewPointTemperature": 9.37, "feelsLikeTemperature": 8.34, "windSpeed10m": 4.29, "windDirectionFrom10m": 187, "windGustSpeed10m": 8.68, "visibility": 10128, "screenRelativeHumidity": 94.17, "mslp": 102910, "uvIndex": 0, "significantWeatherCode": 8, "precipitationRate": 0.0, "probOfPrecipitation": 16 }] } }] } datapoint-python-0.13.0/tests/reference_data/reference_data_test_forecast.py000066400000000000000000002073431474201672100274310ustar00rootroot00000000000000import datetime EXPECTED_FIRST_HOURLY_TIMESTEP = { "time": datetime.datetime(2024, 2, 15, 19, 0, tzinfo=datetime.timezone.utc), "screenTemperature": { "value": 11.0, "description": "Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "maxScreenAirTemp": { "value": 11.55, "description": "Maximum Screen Air Temperature Over Previous Hour", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "minScreenAirTemp": { "value": 10.98, "description": "Minimum Screen Air Temperature Over Previous Hour", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "screenDewPointTemperature": { "value": 8.94, "description": "Screen Dew Point Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "feelsLikeTemperature": { "value": 10.87, "description": "Feels Like Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "windSpeed10m": { "value": 1.18, "description": "10m Wind Speed", "unit_name": "metres per second", "unit_symbol": "m/s", }, "windDirectionFrom10m": { "value": 180, "description": "10m Wind From Direction", "unit_name": "degrees", "unit_symbol": "deg", }, "windGustSpeed10m": { "value": 6.69, "description": "10m Wind Gust Speed", "unit_name": "metres per second", "unit_symbol": "m/s", }, "max10mWindGust": { "value": 8.92, "description": "Maximum 10m Wind Gust Speed Over Previous Hour", "unit_name": "metres per second", "unit_symbol": "m/s", }, "visibility": { "value": 19174, "description": "Visibility", "unit_name": "metres", "unit_symbol": "m", }, "screenRelativeHumidity": { "value": 86.99, "description": "Screen Relative Humidity", "unit_name": "percentage", "unit_symbol": "%", }, "mslp": { "value": 100660, "description": "Mean Sea Level Pressure", "unit_name": "pascals", "unit_symbol": "Pa", }, "uvIndex": { "value": 0, "description": "UV Index", "unit_name": "dimensionless", "unit_symbol": "1", }, "significantWeatherCode": { "value": "Partly cloudy", "description": "Significant Weather Code", "unit_name": "dimensionless", "unit_symbol": "1", }, "precipitationRate": { "value": 0.0, "description": "Precipitation Rate", "unit_name": "millimetres per hour", "unit_symbol": "mm/h", }, "totalPrecipAmount": { "value": 0.0, "description": "Total Precipitation Amount Over Previous Hour", "unit_name": "millimetres", "unit_symbol": "mm", }, "totalSnowAmount": { "value": 0, "description": "Total Snow Amount Over Previous Hour", "unit_name": "millimetres", "unit_symbol": "mm", }, "probOfPrecipitation": { "value": 4, "description": "Probability of Precipitation", "unit_name": "percentage", "unit_symbol": "%", }, } EXPECTED_FIRST_HOURLY_TIMESTEP_RAW_WEATHER_CODE = { "time": datetime.datetime(2024, 2, 15, 19, 0, tzinfo=datetime.timezone.utc), "screenTemperature": { "value": 11.0, "description": "Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "maxScreenAirTemp": { "value": 11.55, "description": "Maximum Screen Air Temperature Over Previous Hour", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "minScreenAirTemp": { "value": 10.98, "description": "Minimum Screen Air Temperature Over Previous Hour", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "screenDewPointTemperature": { "value": 8.94, "description": "Screen Dew Point Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "feelsLikeTemperature": { "value": 10.87, "description": "Feels Like Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "windSpeed10m": { "value": 1.18, "description": "10m Wind Speed", "unit_name": "metres per second", "unit_symbol": "m/s", }, "windDirectionFrom10m": { "value": 180, "description": "10m Wind From Direction", "unit_name": "degrees", "unit_symbol": "deg", }, "windGustSpeed10m": { "value": 6.69, "description": "10m Wind Gust Speed", "unit_name": "metres per second", "unit_symbol": "m/s", }, "max10mWindGust": { "value": 8.92, "description": "Maximum 10m Wind Gust Speed Over Previous Hour", "unit_name": "metres per second", "unit_symbol": "m/s", }, "visibility": { "value": 19174, "description": "Visibility", "unit_name": "metres", "unit_symbol": "m", }, "screenRelativeHumidity": { "value": 86.99, "description": "Screen Relative Humidity", "unit_name": "percentage", "unit_symbol": "%", }, "mslp": { "value": 100660, "description": "Mean Sea Level Pressure", "unit_name": "pascals", "unit_symbol": "Pa", }, "uvIndex": { "value": 0, "description": "UV Index", "unit_name": "dimensionless", "unit_symbol": "1", }, "significantWeatherCode": { "value": 2, "description": "Significant Weather Code", "unit_name": "dimensionless", "unit_symbol": "1", }, "precipitationRate": { "value": 0.0, "description": "Precipitation Rate", "unit_name": "millimetres per hour", "unit_symbol": "mm/h", }, "totalPrecipAmount": { "value": 0.0, "description": "Total Precipitation Amount Over Previous Hour", "unit_name": "millimetres", "unit_symbol": "mm", }, "totalSnowAmount": { "value": 0, "description": "Total Snow Amount Over Previous Hour", "unit_name": "millimetres", "unit_symbol": "mm", }, "probOfPrecipitation": { "value": 4, "description": "Probability of Precipitation", "unit_name": "percentage", "unit_symbol": "%", }, } EXPECTED_AT_DATETIME_HOURLY_TIMESTEP = { "time": datetime.datetime(2024, 2, 16, 19, 0, tzinfo=datetime.timezone.utc), "screenTemperature": { "value": 8.94, "description": "Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "maxScreenAirTemp": { "value": 9.6, "description": "Maximum Screen Air Temperature Over Previous Hour", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "minScreenAirTemp": { "value": 8.9, "description": "Minimum Screen Air Temperature Over Previous Hour", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "screenDewPointTemperature": { "value": 6.8, "description": "Screen Dew Point Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "feelsLikeTemperature": { "value": 7.68, "description": "Feels Like Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "windSpeed10m": { "value": 2.46, "description": "10m Wind Speed", "unit_name": "metres per second", "unit_symbol": "m/s", }, "windDirectionFrom10m": { "value": 255, "description": "10m Wind From Direction", "unit_name": "degrees", "unit_symbol": "deg", }, "windGustSpeed10m": { "value": 7.35, "description": "10m Wind Gust Speed", "unit_name": "metres per second", "unit_symbol": "m/s", }, "max10mWindGust": { "value": 8.02, "description": "Maximum 10m Wind Gust Speed Over Previous Hour", "unit_name": "metres per second", "unit_symbol": "m/s", }, "visibility": { "value": 22767, "description": "Visibility", "unit_name": "metres", "unit_symbol": "m", }, "screenRelativeHumidity": { "value": 86.81, "description": "Screen Relative Humidity", "unit_name": "percentage", "unit_symbol": "%", }, "mslp": { "value": 102246, "description": "Mean Sea Level Pressure", "unit_name": "pascals", "unit_symbol": "Pa", }, "uvIndex": { "value": 0, "description": "UV Index", "unit_name": "dimensionless", "unit_symbol": "1", }, "significantWeatherCode": { "value": "Clear night", "description": "Significant Weather Code", "unit_name": "dimensionless", "unit_symbol": "1", }, "precipitationRate": { "value": 0.0, "description": "Precipitation Rate", "unit_name": "millimetres per hour", "unit_symbol": "mm/h", }, "totalPrecipAmount": { "value": 0.0, "description": "Total Precipitation Amount Over Previous Hour", "unit_name": "millimetres", "unit_symbol": "mm", }, "totalSnowAmount": { "value": 0, "description": "Total Snow Amount Over Previous Hour", "unit_name": "millimetres", "unit_symbol": "mm", }, "probOfPrecipitation": { "value": 0, "description": "Probability of Precipitation", "unit_name": "percentage", "unit_symbol": "%", }, } EXPECTED_AT_DATETIME_HOURLY_FINAL_TIMESTEP = { "time": datetime.datetime(2024, 2, 17, 19, 0, tzinfo=datetime.timezone.utc), "screenTemperature": { "value": 10.34, "description": "Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "screenDewPointTemperature": { "value": 9.37, "description": "Screen Dew Point Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "feelsLikeTemperature": { "value": 8.34, "description": "Feels Like Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "windSpeed10m": { "value": 4.29, "description": "10m Wind Speed", "unit_name": "metres per second", "unit_symbol": "m/s", }, "windDirectionFrom10m": { "value": 187, "description": "10m Wind From Direction", "unit_name": "degrees", "unit_symbol": "deg", }, "windGustSpeed10m": { "value": 8.68, "description": "10m Wind Gust Speed", "unit_name": "metres per second", "unit_symbol": "m/s", }, "visibility": { "value": 10128, "description": "Visibility", "unit_name": "metres", "unit_symbol": "m", }, "screenRelativeHumidity": { "value": 94.17, "description": "Screen Relative Humidity", "unit_name": "percentage", "unit_symbol": "%", }, "mslp": { "value": 102910, "description": "Mean Sea Level Pressure", "unit_name": "pascals", "unit_symbol": "Pa", }, "uvIndex": { "value": 0, "description": "UV Index", "unit_name": "dimensionless", "unit_symbol": "1", }, "significantWeatherCode": { "value": "Overcast", "description": "Significant Weather Code", "unit_name": "dimensionless", "unit_symbol": "1", }, "precipitationRate": { "value": 0.0, "description": "Precipitation Rate", "unit_name": "millimetres per hour", "unit_symbol": "mm/h", }, "probOfPrecipitation": { "value": 16, "description": "Probability of Precipitation", "unit_name": "percentage", "unit_symbol": "%", }, } EXPECTED_FIRST_DAILY_TIMESTEP = { "time": datetime.datetime(2024, 2, 16, 0, 0, tzinfo=datetime.timezone.utc), "midday10MWindSpeed": { "value": 5.04, "description": "10m Wind Speed at Local Midday", "unit_name": "metres per second", "unit_symbol": "m/s", }, "midnight10MWindSpeed": { "value": 1.39, "description": "10m Wind Speed at Local Midnight", "unit_name": "metres per second", "unit_symbol": "m/s", }, "midday10MWindDirection": { "value": 273, "description": "10m Wind Direction at Local Midday", "unit_name": "degrees", "unit_symbol": "deg", }, "midnight10MWindDirection": { "value": 243, "description": "10m Wind Direction at Local Midnight", "unit_name": "degrees", "unit_symbol": "deg", }, "midday10MWindGust": { "value": 8.75, "description": "10m Wind Gust Speed at Local Midday", "unit_name": "metres per second", "unit_symbol": "m/s", }, "midnight10MWindGust": { "value": 7.2, "description": "10m Wind Gust Speed at Local Midnight", "unit_name": "metres per second", "unit_symbol": "m/s", }, "middayVisibility": { "value": 28772, "description": "Visibility at Local Midday", "unit_name": "metres", "unit_symbol": "m", }, "midnightVisibility": { "value": 27712, "description": "Visibility at Local Midnight", "unit_name": "metres", "unit_symbol": "m", }, "middayRelativeHumidity": { "value": 75.21, "description": "Relative Humidity at Local Midday", "unit_name": "percentage", "unit_symbol": "%", }, "midnightRelativeHumidity": { "value": 80.91, "description": "Relative Humidity at Local Midnight", "unit_name": "percentage", "unit_symbol": "%", }, "middayMslp": { "value": 101680, "description": "Mean Sea Level Pressure at Local Midday", "unit_name": "pascals", "unit_symbol": "Pa", }, "midnightMslp": { "value": 102640, "description": "Mean Sea Level Pressure at Local Midnight", "unit_name": "pascals", "unit_symbol": "Pa", }, "nightSignificantWeatherCode": { "value": "Cloudy", "description": "Night Significant Weather Code", "unit_name": "dimensionless", "unit_symbol": "1", }, "dayMaxScreenTemperature": { "value": 12.82, "description": "Day Maximum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightMinScreenTemperature": { "value": 5.32, "description": "Night Minimum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "dayUpperBoundMaxTemp": { "value": 14.1, "description": "Upper Bound on Day Maximum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightUpperBoundMinTemp": { "value": 9.17, "description": "Upper Bound on Night Minimum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "dayLowerBoundMaxTemp": { "value": 11.97, "description": "Lower Bound on Day Maximum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightLowerBoundMinTemp": { "value": 3.56, "description": "Lower Bound on Night Minimum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightMinFeelsLikeTemp": { "value": 6.27, "description": "Night Minimum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "dayUpperBoundMaxFeelsLikeTemp": { "value": 12.47, "description": "Upper Bound on Day Maximum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightUpperBoundMinFeelsLikeTemp": { "value": 8.74, "description": "Upper Bound on Night Minimum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "dayLowerBoundMaxFeelsLikeTemp": { "value": 10.01, "description": "Lower Bound on Day Maximum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightLowerBoundMinFeelsLikeTemp": { "value": 2.75, "description": "Lower Bound on Night Minimum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightProbabilityOfPrecipitation": { "value": 11, "description": "Probability of Precipitation During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfSnow": { "value": 0, "description": "Probability of Snow During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfHeavySnow": { "value": 0, "description": "Probability of Heavy Snow During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfRain": { "value": 10, "description": "Probability of Rain During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfHeavyRain": { "value": 0, "description": "Probability of Heavy Rain During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfHail": { "value": 0, "description": "Probability of Hail During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfSferics": { "value": 0, "description": "Probability of Sferics During The Night", "unit_name": "percentage", "unit_symbol": "%", }, } EXPECTED_FIRST_DAILY_TIMESTEP_RAW_WEATHER_CODE = { "time": datetime.datetime(2024, 2, 16, 0, 0, tzinfo=datetime.timezone.utc), "midday10MWindSpeed": { "value": 5.04, "description": "10m Wind Speed at Local Midday", "unit_name": "metres per second", "unit_symbol": "m/s", }, "midnight10MWindSpeed": { "value": 1.39, "description": "10m Wind Speed at Local Midnight", "unit_name": "metres per second", "unit_symbol": "m/s", }, "midday10MWindDirection": { "value": 273, "description": "10m Wind Direction at Local Midday", "unit_name": "degrees", "unit_symbol": "deg", }, "midnight10MWindDirection": { "value": 243, "description": "10m Wind Direction at Local Midnight", "unit_name": "degrees", "unit_symbol": "deg", }, "midday10MWindGust": { "value": 8.75, "description": "10m Wind Gust Speed at Local Midday", "unit_name": "metres per second", "unit_symbol": "m/s", }, "midnight10MWindGust": { "value": 7.2, "description": "10m Wind Gust Speed at Local Midnight", "unit_name": "metres per second", "unit_symbol": "m/s", }, "middayVisibility": { "value": 28772, "description": "Visibility at Local Midday", "unit_name": "metres", "unit_symbol": "m", }, "midnightVisibility": { "value": 27712, "description": "Visibility at Local Midnight", "unit_name": "metres", "unit_symbol": "m", }, "middayRelativeHumidity": { "value": 75.21, "description": "Relative Humidity at Local Midday", "unit_name": "percentage", "unit_symbol": "%", }, "midnightRelativeHumidity": { "value": 80.91, "description": "Relative Humidity at Local Midnight", "unit_name": "percentage", "unit_symbol": "%", }, "middayMslp": { "value": 101680, "description": "Mean Sea Level Pressure at Local Midday", "unit_name": "pascals", "unit_symbol": "Pa", }, "midnightMslp": { "value": 102640, "description": "Mean Sea Level Pressure at Local Midnight", "unit_name": "pascals", "unit_symbol": "Pa", }, "nightSignificantWeatherCode": { "value": 7, "description": "Night Significant Weather Code", "unit_name": "dimensionless", "unit_symbol": "1", }, "dayMaxScreenTemperature": { "value": 12.82, "description": "Day Maximum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightMinScreenTemperature": { "value": 5.32, "description": "Night Minimum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "dayUpperBoundMaxTemp": { "value": 14.1, "description": "Upper Bound on Day Maximum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightUpperBoundMinTemp": { "value": 9.17, "description": "Upper Bound on Night Minimum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "dayLowerBoundMaxTemp": { "value": 11.97, "description": "Lower Bound on Day Maximum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightLowerBoundMinTemp": { "value": 3.56, "description": "Lower Bound on Night Minimum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightMinFeelsLikeTemp": { "value": 6.27, "description": "Night Minimum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "dayUpperBoundMaxFeelsLikeTemp": { "value": 12.47, "description": "Upper Bound on Day Maximum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightUpperBoundMinFeelsLikeTemp": { "value": 8.74, "description": "Upper Bound on Night Minimum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "dayLowerBoundMaxFeelsLikeTemp": { "value": 10.01, "description": "Lower Bound on Day Maximum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightLowerBoundMinFeelsLikeTemp": { "value": 2.75, "description": "Lower Bound on Night Minimum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightProbabilityOfPrecipitation": { "value": 11, "description": "Probability of Precipitation During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfSnow": { "value": 0, "description": "Probability of Snow During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfHeavySnow": { "value": 0, "description": "Probability of Heavy Snow During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfRain": { "value": 10, "description": "Probability of Rain During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfHeavyRain": { "value": 0, "description": "Probability of Heavy Rain During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfHail": { "value": 0, "description": "Probability of Hail During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfSferics": { "value": 0, "description": "Probability of Sferics During The Night", "unit_name": "percentage", "unit_symbol": "%", }, } EXPECTED_AT_DATETIME_DAILY_TIMESTEP = { "time": datetime.datetime(2024, 2, 17, 0, 0, tzinfo=datetime.timezone.utc), "midday10MWindSpeed": { "value": 4.32, "description": "10m Wind Speed at Local Midday", "unit_name": "metres per second", "unit_symbol": "m/s", }, "midnight10MWindSpeed": { "value": 6.1, "description": "10m Wind Speed at Local Midnight", "unit_name": "metres per second", "unit_symbol": "m/s", }, "midday10MWindDirection": { "value": 230, "description": "10m Wind Direction at Local Midday", "unit_name": "degrees", "unit_symbol": "deg", }, "midnight10MWindDirection": { "value": 218, "description": "10m Wind Direction at Local Midnight", "unit_name": "degrees", "unit_symbol": "deg", }, "midday10MWindGust": { "value": 8.75, "description": "10m Wind Gust Speed at Local Midday", "unit_name": "metres per second", "unit_symbol": "m/s", }, "midnight10MWindGust": { "value": 12.98, "description": "10m Wind Gust Speed at Local Midnight", "unit_name": "metres per second", "unit_symbol": "m/s", }, "middayVisibility": { "value": 4158, "description": "Visibility at Local Midday", "unit_name": "metres", "unit_symbol": "m", }, "midnightVisibility": { "value": 5915, "description": "Visibility at Local Midnight", "unit_name": "metres", "unit_symbol": "m", }, "middayRelativeHumidity": { "value": 97.38, "description": "Relative Humidity at Local Midday", "unit_name": "percentage", "unit_symbol": "%", }, "midnightRelativeHumidity": { "value": 93.62, "description": "Relative Humidity at Local Midnight", "unit_name": "percentage", "unit_symbol": "%", }, "middayMslp": { "value": 103140, "description": "Mean Sea Level Pressure at Local Midday", "unit_name": "pascals", "unit_symbol": "Pa", }, "midnightMslp": { "value": 102800, "description": "Mean Sea Level Pressure at Local Midnight", "unit_name": "pascals", "unit_symbol": "Pa", }, "maxUvIndex": { "value": 1, "description": "Day Maximum UV Index", "unit_name": "dimensionless", "unit_symbol": "1", }, "daySignificantWeatherCode": { "value": "Overcast", "description": "Day Significant Weather Code", "unit_name": "dimensionless", "unit_symbol": "1", }, "nightSignificantWeatherCode": { "value": "Heavy rain", "description": "Night Significant Weather Code", "unit_name": "dimensionless", "unit_symbol": "1", }, "dayMaxScreenTemperature": { "value": 12.0, "description": "Day Maximum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightMinScreenTemperature": { "value": 9.96, "description": "Night Minimum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "dayUpperBoundMaxTemp": { "value": 13.71, "description": "Upper Bound on Day Maximum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightUpperBoundMinTemp": { "value": 10.71, "description": "Upper Bound on Night Minimum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "dayLowerBoundMaxTemp": { "value": 10.23, "description": "Lower Bound on Day Maximum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightLowerBoundMinTemp": { "value": 9.04, "description": "Lower Bound on Night Minimum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "dayMaxFeelsLikeTemp": { "value": 10.6, "description": "Day Maximum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightMinFeelsLikeTemp": { "value": 7.76, "description": "Night Minimum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "dayUpperBoundMaxFeelsLikeTemp": { "value": 11.49, "description": "Upper Bound on Day Maximum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightUpperBoundMinFeelsLikeTemp": { "value": 8.28, "description": "Upper Bound on Night Minimum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "dayLowerBoundMaxFeelsLikeTemp": { "value": 8.38, "description": "Lower Bound on Day Maximum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightLowerBoundMinFeelsLikeTemp": { "value": 7.04, "description": "Lower Bound on Night Minimum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "dayProbabilityOfPrecipitation": { "value": 18, "description": "Probability of Precipitation During The Day", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfPrecipitation": { "value": 97, "description": "Probability of Precipitation During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "dayProbabilityOfSnow": { "value": 0, "description": "Probability of Snow During The Day", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfSnow": { "value": 0, "description": "Probability of Snow During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "dayProbabilityOfHeavySnow": { "value": 0, "description": "Probability of Heavy Snow During The Day", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfHeavySnow": { "value": 0, "description": "Probability of Heavy Snow During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "dayProbabilityOfRain": { "value": 18, "description": "Probability of Rain During The Day", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfRain": { "value": 97, "description": "Probability of Rain During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "dayProbabilityOfHeavyRain": { "value": 5, "description": "Probability of Heavy Rain During The Day", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfHeavyRain": { "value": 96, "description": "Probability of Heavy Rain During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "dayProbabilityOfHail": { "value": 0, "description": "Probability of Hail During The Day", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfHail": { "value": 20, "description": "Probability of Hail During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "dayProbabilityOfSferics": { "value": 0, "description": "Probability of Sferics During The Day", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfSferics": { "value": 10, "description": "Probability of Sferics During The Night", "unit_name": "percentage", "unit_symbol": "%", }, } EXPECTED_AT_DATETIME_DAILY_FINAL_TIMESTEP = { "time": datetime.datetime(2024, 2, 18, 0, 0, tzinfo=datetime.timezone.utc), "midday10MWindSpeed": { "value": 4.07, "description": "10m Wind Speed at Local Midday", "unit_name": "metres per second", "unit_symbol": "m/s", }, "midnight10MWindSpeed": { "value": 2.84, "description": "10m Wind Speed at Local Midnight", "unit_name": "metres per second", "unit_symbol": "m/s", }, "midday10MWindDirection": { "value": 292, "description": "10m Wind Direction at Local Midday", "unit_name": "degrees", "unit_symbol": "deg", }, "midnight10MWindDirection": { "value": 281, "description": "10m Wind Direction at Local Midnight", "unit_name": "degrees", "unit_symbol": "deg", }, "midday10MWindGust": { "value": 7.55, "description": "10m Wind Gust Speed at Local Midday", "unit_name": "metres per second", "unit_symbol": "m/s", }, "midnight10MWindGust": { "value": 6.36, "description": "10m Wind Gust Speed at Local Midnight", "unit_name": "metres per second", "unit_symbol": "m/s", }, "middayVisibility": { "value": 25425, "description": "Visibility at Local Midday", "unit_name": "metres", "unit_symbol": "m", }, "midnightVisibility": { "value": 17183, "description": "Visibility at Local Midnight", "unit_name": "metres", "unit_symbol": "m", }, "middayRelativeHumidity": { "value": 86.19, "description": "Relative Humidity at Local Midday", "unit_name": "percentage", "unit_symbol": "%", }, "midnightRelativeHumidity": { "value": 94.68, "description": "Relative Humidity at Local Midnight", "unit_name": "percentage", "unit_symbol": "%", }, "middayMslp": { "value": 102625, "description": "Mean Sea Level Pressure at Local Midday", "unit_name": "pascals", "unit_symbol": "Pa", }, "midnightMslp": { "value": 103041, "description": "Mean Sea Level Pressure at Local Midnight", "unit_name": "pascals", "unit_symbol": "Pa", }, "maxUvIndex": { "value": 1, "description": "Day Maximum UV Index", "unit_name": "dimensionless", "unit_symbol": "1", }, "daySignificantWeatherCode": { "value": "Light rain", "description": "Day Significant Weather Code", "unit_name": "dimensionless", "unit_symbol": "1", }, "nightSignificantWeatherCode": { "value": "Cloudy", "description": "Night Significant Weather Code", "unit_name": "dimensionless", "unit_symbol": "1", }, "dayMaxScreenTemperature": { "value": 13.89, "description": "Day Maximum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightMinScreenTemperature": { "value": 7.15, "description": "Night Minimum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "dayUpperBoundMaxTemp": { "value": 14.73, "description": "Upper Bound on Day Maximum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightUpperBoundMinTemp": { "value": 9.16, "description": "Upper Bound on Night Minimum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "dayLowerBoundMaxTemp": { "value": 12.4, "description": "Lower Bound on Day Maximum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightLowerBoundMinTemp": { "value": 5.31, "description": "Lower Bound on Night Minimum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "dayMaxFeelsLikeTemp": { "value": 11.75, "description": "Day Maximum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightMinFeelsLikeTemp": { "value": 5.34, "description": "Night Minimum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "dayUpperBoundMaxFeelsLikeTemp": { "value": 13.47, "description": "Upper Bound on Day Maximum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightUpperBoundMinFeelsLikeTemp": { "value": 7.12, "description": "Upper Bound on Night Minimum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "dayLowerBoundMaxFeelsLikeTemp": { "value": 10.8, "description": "Lower Bound on Day Maximum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightLowerBoundMinFeelsLikeTemp": { "value": 5.06, "description": "Lower Bound on Night Minimum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "dayProbabilityOfPrecipitation": { "value": 55, "description": "Probability of Precipitation During The Day", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfPrecipitation": { "value": 9, "description": "Probability of Precipitation During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "dayProbabilityOfSnow": { "value": 0, "description": "Probability of Snow During The Day", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfSnow": { "value": 0, "description": "Probability of Snow During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "dayProbabilityOfHeavySnow": { "value": 0, "description": "Probability of Heavy Snow During The Day", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfHeavySnow": { "value": 0, "description": "Probability of Heavy Snow During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "dayProbabilityOfRain": { "value": 55, "description": "Probability of Rain During The Day", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfRain": { "value": 9, "description": "Probability of Rain During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "dayProbabilityOfHeavyRain": { "value": 36, "description": "Probability of Heavy Rain During The Day", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfHeavyRain": { "value": 2, "description": "Probability of Heavy Rain During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "dayProbabilityOfHail": { "value": 4, "description": "Probability of Hail During The Day", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfHail": { "value": 0, "description": "Probability of Hail During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "dayProbabilityOfSferics": { "value": 3, "description": "Probability of Sferics During The Day", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfSferics": { "value": 0, "description": "Probability of Sferics During The Night", "unit_name": "percentage", "unit_symbol": "%", }, } EXPECTED_FIRST_THREE_HOURLY_TIMESTEP = { "time": datetime.datetime(2024, 2, 17, 15, 0, tzinfo=datetime.timezone.utc), "maxScreenAirTemp": { "value": 12.0, "description": "Maximum Screen Air Temperature Over Previous Three Hours", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "minScreenAirTemp": { "value": 10.73, "description": "Minimum Screen Air Temperature Over Previous Three Hours", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "max10mWindGust": { "value": 8.87, "description": "Maximum 10m Wind Gust Speed Over Previous Three Hours", "unit_name": "metres per second", "unit_symbol": "m/s", }, "significantWeatherCode": { "value": "Overcast", "description": "Three Hour Significant Weather Code", "unit_name": "dimensionless", "unit_symbol": "1", }, "totalPrecipAmount": { "value": 0.0, "description": "Total Precipitation Amount Over Previous Three Hours", "unit_name": "millimetres", "unit_symbol": "mm", }, "totalSnowAmount": { "value": 0, "description": "Total Snow Amount Over Previous Three Hours", "unit_name": "millimetres", "unit_symbol": "mm", }, "windSpeed10m": { "value": 5.04, "description": "10m Wind Speed Over Previous Three Hours", "unit_name": "metres per second", "unit_symbol": "m/s", }, "windDirectionFrom10m": { "value": 225, "description": "10m Wind From Direction Over Previous Three Hours", "unit_name": "degrees", "unit_symbol": "deg", }, "windGustSpeed10m": { "value": 8.75, "description": "10m Wind Gust Speed Over Previous Three Hours", "unit_name": "metres per second", "unit_symbol": "m/s", }, "visibility": { "value": 9118, "description": "Visibility Over Previous Three Hours", "unit_name": "metres", "unit_symbol": "m", }, "mslp": { "value": 103090, "description": "Mean Sea Level Pressure Over Previous Three Hours", "unit_name": "pascals", "unit_symbol": "Pa", }, "screenRelativeHumidity": { "value": 96.84, "description": "Screen Relative Humidity Over Previous Three Hours", "unit_name": "percentage", "unit_symbol": "%", }, "feelsLikeTemp": { "value": 8.53, "description": "Feels Like Temperature Over Previous Three Hours", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "uvIndex": { "value": 1, "description": "Maximum UV Index Over Previous Three Hours", "unit_name": "dimensionless", "unit_symbol": "1", }, "probOfPrecipitation": { "value": 10, "description": "Three Hour Probability of Precipitation", "unit_name": "percentage", "unit_symbol": "%", }, "probOfSnow": { "value": 0, "description": "Three Hour Probability of Snow", "unit_name": "percentage", "unit_symbol": "%", }, "probOfHeavySnow": { "value": 0, "description": "Three Hour Probability of Heavy Snow", "unit_name": "percentage", "unit_symbol": "%", }, "probOfRain": { "value": 10, "description": "Three Hour Probability of Rain", "unit_name": "percentage", "unit_symbol": "%", }, "probOfHeavyRain": { "value": 0, "description": "Three Hour Probability of Heavy Rain", "unit_name": "percentage", "unit_symbol": "%", }, "probOfHail": { "value": 0, "description": "Three Hour Probability of Hail", "unit_name": "percentage", "unit_symbol": "%", }, "probOfSferics": { "value": 0, "description": "Three Hour Probability of Sferics", "unit_name": "percentage", "unit_symbol": "%", }, } EXPECTED_AT_DATETIME_THREE_HOURLY_TIMESTEP = { "time": datetime.datetime(2024, 2, 22, 18, 0, tzinfo=datetime.timezone.utc), "maxScreenAirTemp": { "value": 9.82, "description": "Maximum Screen Air Temperature Over Previous Three Hours", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "minScreenAirTemp": { "value": 7.61, "description": "Minimum Screen Air Temperature Over Previous Three Hours", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "max10mWindGust": { "value": 19.28, "description": "Maximum 10m Wind Gust Speed Over Previous Three Hours", "unit_name": "metres per second", "unit_symbol": "m/s", }, "significantWeatherCode": { "value": "Light rain shower", "description": "Three Hour Significant Weather Code", "unit_name": "dimensionless", "unit_symbol": "1", }, "totalPrecipAmount": { "value": 1.11, "description": "Total Precipitation Amount Over Previous Three Hours", "unit_name": "millimetres", "unit_symbol": "mm", }, "totalSnowAmount": { "value": 0, "description": "Total Snow Amount Over Previous Three Hours", "unit_name": "millimetres", "unit_symbol": "mm", }, "windSpeed10m": { "value": 7.91, "description": "10m Wind Speed Over Previous Three Hours", "unit_name": "metres per second", "unit_symbol": "m/s", }, "windDirectionFrom10m": { "value": 239, "description": "10m Wind From Direction Over Previous Three Hours", "unit_name": "degrees", "unit_symbol": "deg", }, "windGustSpeed10m": { "value": 14.42, "description": "10m Wind Gust Speed Over Previous Three Hours", "unit_name": "metres per second", "unit_symbol": "m/s", }, "visibility": { "value": 20148, "description": "Visibility Over Previous Three Hours", "unit_name": "metres", "unit_symbol": "m", }, "mslp": { "value": 98434, "description": "Mean Sea Level Pressure Over Previous Three Hours", "unit_name": "pascals", "unit_symbol": "Pa", }, "screenRelativeHumidity": { "value": 79.36, "description": "Screen Relative Humidity Over Previous Three Hours", "unit_name": "percentage", "unit_symbol": "%", }, "feelsLikeTemp": { "value": 3.74, "description": "Feels Like Temperature Over Previous Three Hours", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "uvIndex": { "value": 0, "description": "Maximum UV Index Over Previous Three Hours", "unit_name": "dimensionless", "unit_symbol": "1", }, "probOfPrecipitation": { "value": 44, "description": "Three Hour Probability of Precipitation", "unit_name": "percentage", "unit_symbol": "%", }, "probOfSnow": { "value": 0, "description": "Three Hour Probability of Snow", "unit_name": "percentage", "unit_symbol": "%", }, "probOfHeavySnow": { "value": 0, "description": "Three Hour Probability of Heavy Snow", "unit_name": "percentage", "unit_symbol": "%", }, "probOfRain": { "value": 44, "description": "Three Hour Probability of Rain", "unit_name": "percentage", "unit_symbol": "%", }, "probOfHeavyRain": { "value": 32, "description": "Three Hour Probability of Heavy Rain", "unit_name": "percentage", "unit_symbol": "%", }, "probOfHail": { "value": 4, "description": "Three Hour Probability of Hail", "unit_name": "percentage", "unit_symbol": "%", }, "probOfSferics": { "value": 6, "description": "Three Hour Probability of Sferics", "unit_name": "percentage", "unit_symbol": "%", }, } EXPECTED_AT_DATETIME_THREE_HOURLY_FINAL_TIMESTEP = { "time": datetime.datetime(2024, 2, 24, 15, 0, tzinfo=datetime.timezone.utc), "maxScreenAirTemp": { "value": 8.25, "description": "Maximum Screen Air Temperature Over Previous Three Hours", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "minScreenAirTemp": { "value": 7.96, "description": "Minimum Screen Air Temperature Over Previous Three Hours", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "max10mWindGust": { "value": 12.77, "description": "Maximum 10m Wind Gust Speed Over Previous Three Hours", "unit_name": "metres per second", "unit_symbol": "m/s", }, "significantWeatherCode": { "value": "Light rain shower", "description": "Three Hour Significant Weather Code", "unit_name": "dimensionless", "unit_symbol": "1", }, "totalPrecipAmount": { "value": 0.58, "description": "Total Precipitation Amount Over Previous Three Hours", "unit_name": "millimetres", "unit_symbol": "mm", }, "totalSnowAmount": { "value": 0, "description": "Total Snow Amount Over Previous Three Hours", "unit_name": "millimetres", "unit_symbol": "mm", }, "windSpeed10m": { "value": 5.98, "description": "10m Wind Speed Over Previous Three Hours", "unit_name": "metres per second", "unit_symbol": "m/s", }, "windDirectionFrom10m": { "value": 228, "description": "10m Wind From Direction Over Previous Three Hours", "unit_name": "degrees", "unit_symbol": "deg", }, "windGustSpeed10m": { "value": 11.48, "description": "10m Wind Gust Speed Over Previous Three Hours", "unit_name": "metres per second", "unit_symbol": "m/s", }, "visibility": { "value": 22483, "description": "Visibility Over Previous Three Hours", "unit_name": "metres", "unit_symbol": "m", }, "mslp": { "value": 99725, "description": "Mean Sea Level Pressure Over Previous Three Hours", "unit_name": "pascals", "unit_symbol": "Pa", }, "screenRelativeHumidity": { "value": 72.01, "description": "Screen Relative Humidity Over Previous Three Hours", "unit_name": "percentage", "unit_symbol": "%", }, "feelsLikeTemp": { "value": 4.97, "description": "Feels Like Temperature Over Previous Three Hours", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "uvIndex": { "value": 1, "description": "Maximum UV Index Over Previous Three Hours", "unit_name": "dimensionless", "unit_symbol": "1", }, "probOfPrecipitation": { "value": 32, "description": "Three Hour Probability of Precipitation", "unit_name": "percentage", "unit_symbol": "%", }, "probOfSnow": { "value": 0, "description": "Three Hour Probability of Snow", "unit_name": "percentage", "unit_symbol": "%", }, "probOfHeavySnow": { "value": 0, "description": "Three Hour Probability of Heavy Snow", "unit_name": "percentage", "unit_symbol": "%", }, "probOfRain": { "value": 32, "description": "Three Hour Probability of Rain", "unit_name": "percentage", "unit_symbol": "%", }, "probOfHeavyRain": { "value": 17, "description": "Three Hour Probability of Heavy Rain", "unit_name": "percentage", "unit_symbol": "%", }, "probOfHail": { "value": 1, "description": "Three Hour Probability of Hail", "unit_name": "percentage", "unit_symbol": "%", }, "probOfSferics": { "value": 3, "description": "Three Hour Probability of Sferics", "unit_name": "percentage", "unit_symbol": "%", }, } EXPECTED_FIRST_TWICE_DAILY_TIMESTEP = { "time": datetime.datetime(2024, 2, 16, 0, 0, tzinfo=datetime.timezone.utc), "midnight10MWindSpeed": { "value": 1.39, "description": "10m Wind Speed at Local Midnight", "unit_name": "metres per second", "unit_symbol": "m/s", }, "midnight10MWindDirection": { "value": 243, "description": "10m Wind Direction at Local Midnight", "unit_name": "degrees", "unit_symbol": "deg", }, "midnight10MWindGust": { "value": 7.2, "description": "10m Wind Gust Speed at Local Midnight", "unit_name": "metres per second", "unit_symbol": "m/s", }, "midnightVisibility": { "value": 27712, "description": "Visibility at Local Midnight", "unit_name": "metres", "unit_symbol": "m", }, "midnightRelativeHumidity": { "value": 80.91, "description": "Relative Humidity at Local Midnight", "unit_name": "percentage", "unit_symbol": "%", }, "midnightMslp": { "value": 102640, "description": "Mean Sea Level Pressure at Local Midnight", "unit_name": "pascals", "unit_symbol": "Pa", }, "nightSignificantWeatherCode": { "value": "Cloudy", "description": "Night Significant Weather Code", "unit_name": "dimensionless", "unit_symbol": "1", }, "nightMinScreenTemperature": { "value": 5.32, "description": "Night Minimum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightUpperBoundMinTemp": { "value": 9.17, "description": "Upper Bound on Night Minimum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightLowerBoundMinTemp": { "value": 3.56, "description": "Lower Bound on Night Minimum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightMinFeelsLikeTemp": { "value": 6.27, "description": "Night Minimum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightUpperBoundMinFeelsLikeTemp": { "value": 8.74, "description": "Upper Bound on Night Minimum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightLowerBoundMinFeelsLikeTemp": { "value": 2.75, "description": "Lower Bound on Night Minimum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightProbabilityOfPrecipitation": { "value": 11, "description": "Probability of Precipitation During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfSnow": { "value": 0, "description": "Probability of Snow During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfHeavySnow": { "value": 0, "description": "Probability of Heavy Snow During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfRain": { "value": 10, "description": "Probability of Rain During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfHeavyRain": { "value": 0, "description": "Probability of Heavy Rain During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfHail": { "value": 0, "description": "Probability of Hail During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfSferics": { "value": 0, "description": "Probability of Sferics During The Night", "unit_name": "percentage", "unit_symbol": "%", }, } EXPECTED_AT_DATETIME_TWICE_DAILY_TIMESTEP = { "time": datetime.datetime(2024, 2, 17, 0, 0, tzinfo=datetime.timezone.utc), "midnight10MWindSpeed": { "value": 6.1, "description": "10m Wind Speed at Local Midnight", "unit_name": "metres per second", "unit_symbol": "m/s", }, "midnight10MWindDirection": { "value": 218, "description": "10m Wind Direction at Local Midnight", "unit_name": "degrees", "unit_symbol": "deg", }, "midnight10MWindGust": { "value": 12.98, "description": "10m Wind Gust Speed at Local Midnight", "unit_name": "metres per second", "unit_symbol": "m/s", }, "midnightVisibility": { "value": 5915, "description": "Visibility at Local Midnight", "unit_name": "metres", "unit_symbol": "m", }, "midnightRelativeHumidity": { "value": 93.62, "description": "Relative Humidity at Local Midnight", "unit_name": "percentage", "unit_symbol": "%", }, "midnightMslp": { "value": 102800, "description": "Mean Sea Level Pressure at Local Midnight", "unit_name": "pascals", "unit_symbol": "Pa", }, "nightSignificantWeatherCode": { "value": "Heavy rain", "description": "Night Significant Weather Code", "unit_name": "dimensionless", "unit_symbol": "1", }, "nightMinScreenTemperature": { "value": 9.96, "description": "Night Minimum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightUpperBoundMinTemp": { "value": 10.71, "description": "Upper Bound on Night Minimum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightLowerBoundMinTemp": { "value": 9.04, "description": "Lower Bound on Night Minimum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightMinFeelsLikeTemp": { "value": 7.76, "description": "Night Minimum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightUpperBoundMinFeelsLikeTemp": { "value": 8.28, "description": "Upper Bound on Night Minimum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightLowerBoundMinFeelsLikeTemp": { "value": 7.04, "description": "Lower Bound on Night Minimum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightProbabilityOfPrecipitation": { "value": 97, "description": "Probability of Precipitation During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfSnow": { "value": 0, "description": "Probability of Snow During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfHeavySnow": { "value": 0, "description": "Probability of Heavy Snow During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfRain": { "value": 97, "description": "Probability of Rain During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfHeavyRain": { "value": 96, "description": "Probability of Heavy Rain During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfHail": { "value": 20, "description": "Probability of Hail During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfSferics": { "value": 10, "description": "Probability of Sferics During The Night", "unit_name": "percentage", "unit_symbol": "%", }, } EXPECTED_AT_DATETIME_TWICE_DAILY_FINAL_TIMESTEP = { "time": datetime.datetime(2024, 2, 17, 12, 0, tzinfo=datetime.timezone.utc), "midday10MWindSpeed": { "value": 4.32, "description": "10m Wind Speed at Local Midday", "unit_name": "metres per second", "unit_symbol": "m/s", }, "midday10MWindDirection": { "value": 230, "description": "10m Wind Direction at Local Midday", "unit_name": "degrees", "unit_symbol": "deg", }, "midday10MWindGust": { "value": 8.75, "description": "10m Wind Gust Speed at Local Midday", "unit_name": "metres per second", "unit_symbol": "m/s", }, "middayVisibility": { "value": 4158, "description": "Visibility at Local Midday", "unit_name": "metres", "unit_symbol": "m", }, "middayRelativeHumidity": { "value": 97.38, "description": "Relative Humidity at Local Midday", "unit_name": "percentage", "unit_symbol": "%", }, "middayMslp": { "value": 103140, "description": "Mean Sea Level Pressure at Local Midday", "unit_name": "pascals", "unit_symbol": "Pa", }, "maxUvIndex": { "value": 1, "description": "Day Maximum UV Index", "unit_name": "dimensionless", "unit_symbol": "1", }, "daySignificantWeatherCode": { "value": "Overcast", "description": "Day Significant Weather Code", "unit_name": "dimensionless", "unit_symbol": "1", }, "dayMaxScreenTemperature": { "value": 12.0, "description": "Day Maximum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "dayUpperBoundMaxTemp": { "value": 13.71, "description": "Upper Bound on Day Maximum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "dayLowerBoundMaxTemp": { "value": 10.23, "description": "Lower Bound on Day Maximum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "dayMaxFeelsLikeTemp": { "value": 10.6, "description": "Day Maximum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "dayUpperBoundMaxFeelsLikeTemp": { "value": 11.49, "description": "Upper Bound on Day Maximum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "dayLowerBoundMaxFeelsLikeTemp": { "value": 8.38, "description": "Lower Bound on Day Maximum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "dayProbabilityOfPrecipitation": { "value": 18, "description": "Probability of Precipitation During The Day", "unit_name": "percentage", "unit_symbol": "%", }, "dayProbabilityOfSnow": { "value": 0, "description": "Probability of Snow During The Day", "unit_name": "percentage", "unit_symbol": "%", }, "dayProbabilityOfHeavySnow": { "value": 0, "description": "Probability of Heavy Snow During The Day", "unit_name": "percentage", "unit_symbol": "%", }, "dayProbabilityOfRain": { "value": 18, "description": "Probability of Rain During The Day", "unit_name": "percentage", "unit_symbol": "%", }, "dayProbabilityOfHeavyRain": { "value": 5, "description": "Probability of Heavy Rain During The Day", "unit_name": "percentage", "unit_symbol": "%", }, "dayProbabilityOfHail": { "value": 0, "description": "Probability of Hail During The Day", "unit_name": "percentage", "unit_symbol": "%", }, "dayProbabilityOfSferics": { "value": 0, "description": "Probability of Sferics During The Day", "unit_name": "percentage", "unit_symbol": "%", }, } EXPECTED_FIRST_TWICE_DAILY_TIMESTEP_RAW_WEATHER_CODE = { "time": datetime.datetime(2024, 2, 16, 0, 0, tzinfo=datetime.timezone.utc), "midnight10MWindSpeed": { "value": 1.39, "description": "10m Wind Speed at Local Midnight", "unit_name": "metres per second", "unit_symbol": "m/s", }, "midnight10MWindDirection": { "value": 243, "description": "10m Wind Direction at Local Midnight", "unit_name": "degrees", "unit_symbol": "deg", }, "midnight10MWindGust": { "value": 7.2, "description": "10m Wind Gust Speed at Local Midnight", "unit_name": "metres per second", "unit_symbol": "m/s", }, "midnightVisibility": { "value": 27712, "description": "Visibility at Local Midnight", "unit_name": "metres", "unit_symbol": "m", }, "midnightRelativeHumidity": { "value": 80.91, "description": "Relative Humidity at Local Midnight", "unit_name": "percentage", "unit_symbol": "%", }, "midnightMslp": { "value": 102640, "description": "Mean Sea Level Pressure at Local Midnight", "unit_name": "pascals", "unit_symbol": "Pa", }, "nightSignificantWeatherCode": { "value": 7, "description": "Night Significant Weather Code", "unit_name": "dimensionless", "unit_symbol": "1", }, "nightMinScreenTemperature": { "value": 5.32, "description": "Night Minimum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightUpperBoundMinTemp": { "value": 9.17, "description": "Upper Bound on Night Minimum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightLowerBoundMinTemp": { "value": 3.56, "description": "Lower Bound on Night Minimum Screen Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightMinFeelsLikeTemp": { "value": 6.27, "description": "Night Minimum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightUpperBoundMinFeelsLikeTemp": { "value": 8.74, "description": "Upper Bound on Night Minimum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightLowerBoundMinFeelsLikeTemp": { "value": 2.75, "description": "Lower Bound on Night Minimum Feels Like Air Temperature", "unit_name": "degrees Celsius", "unit_symbol": "Cel", }, "nightProbabilityOfPrecipitation": { "value": 11, "description": "Probability of Precipitation During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfSnow": { "value": 0, "description": "Probability of Snow During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfHeavySnow": { "value": 0, "description": "Probability of Heavy Snow During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfRain": { "value": 10, "description": "Probability of Rain During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfHeavyRain": { "value": 0, "description": "Probability of Heavy Rain During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfHail": { "value": 0, "description": "Probability of Hail During The Night", "unit_name": "percentage", "unit_symbol": "%", }, "nightProbabilityOfSferics": { "value": 0, "description": "Probability of Sferics During The Night", "unit_name": "percentage", "unit_symbol": "%", }, } datapoint-python-0.13.0/tests/reference_data/three_hourly_api_data.json000066400000000000000000001617441474201672100264350ustar00rootroot00000000000000{ "type": "FeatureCollection", "parameters": [{ "totalSnowAmount": { "type": "Parameter", "description": "Total Snow Amount Over Previous Three Hours", "unit": { "label": "millimetres", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "mm" } } }, "visibility": { "type": "Parameter", "description": "Visibility Over Previous Three Hours", "unit": { "label": "metres", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "m" } } }, "probOfHail": { "type": "Parameter", "description": "Three Hour Probability of Hail", "unit": { "label": "percentage", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "%" } } }, "windDirectionFrom10m": { "type": "Parameter", "description": "10m Wind From Direction Over Previous Three Hours", "unit": { "label": "degrees", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "deg" } } }, "probOfHeavyRain": { "type": "Parameter", "description": "Three Hour Probability of Heavy Rain", "unit": { "label": "percentage", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "%" } } }, "maxScreenAirTemp": { "type": "Parameter", "description": "Maximum Screen Air Temperature Over Previous Three Hours", "unit": { "label": "degrees Celsius", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "Cel" } } }, "feelsLikeTemp": { "type": "Parameter", "description": "Feels Like Temperature Over Previous Three Hours", "unit": { "label": "degrees Celsius", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "Cel" } } }, "probOfSferics": { "type": "Parameter", "description": "Three Hour Probability of Sferics", "unit": { "label": "percentage", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "%" } } }, "screenRelativeHumidity": { "type": "Parameter", "description": "Screen Relative Humidity Over Previous Three Hours", "unit": { "label": "percentage", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "%" } } }, "windSpeed10m": { "type": "Parameter", "description": "10m Wind Speed Over Previous Three Hours", "unit": { "label": "metres per second", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "m/s" } } }, "probOfPrecipitation": { "type": "Parameter", "description": "Three Hour Probability of Precipitation", "unit": { "label": "percentage", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "%" } } }, "probOfRain": { "type": "Parameter", "description": "Three Hour Probability of Rain", "unit": { "label": "percentage", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "%" } } }, "max10mWindGust": { "type": "Parameter", "description": "Maximum 10m Wind Gust Speed Over Previous Three Hours", "unit": { "label": "metres per second", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "m/s" } } }, "significantWeatherCode": { "type": "Parameter", "description": "Three Hour Significant Weather Code", "unit": { "label": "dimensionless", "symbol": { "value": "https://metoffice.apiconnect.ibmcloud.com/metoffice/production/", "type": "1" } } }, "probOfHeavySnow": { "type": "Parameter", "description": "Three Hour Probability of Heavy Snow", "unit": { "label": "percentage", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "%" } } }, "minScreenAirTemp": { "type": "Parameter", "description": "Minimum Screen Air Temperature Over Previous Three Hours", "unit": { "label": "degrees Celsius", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "Cel" } } }, "totalPrecipAmount": { "type": "Parameter", "description": "Total Precipitation Amount Over Previous Three Hours", "unit": { "label": "millimetres", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "mm" } } }, "mslp": { "type": "Parameter", "description": "Mean Sea Level Pressure Over Previous Three Hours", "unit": { "label": "pascals", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "Pa" } } }, "windGustSpeed10m": { "type": "Parameter", "description": "10m Wind Gust Speed Over Previous Three Hours", "unit": { "label": "metres per second", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "m/s" } } }, "uvIndex": { "type": "Parameter", "description": "Maximum UV Index Over Previous Three Hours", "unit": { "label": "dimensionless", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "1" } } }, "probOfSnow": { "type": "Parameter", "description": "Three Hour Probability of Snow", "unit": { "label": "percentage", "symbol": { "value": "http://www.opengis.net/def/uom/UCUM/", "type": "%" } } } }], "features": [{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [0.0154, 50.9992, 37.0] }, "properties": { "location": { "name": "Sheffield Park" }, "requestPointDistance": 1081.5349, "modelRunDate": "2024-02-17T15:00Z", "timeSeries": [{ "time": "2024-02-17T15:00Z", "maxScreenAirTemp": 12.0, "minScreenAirTemp": 10.73, "max10mWindGust": 8.87, "significantWeatherCode": 8, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 5.04, "windDirectionFrom10m": 225, "windGustSpeed10m": 8.75, "visibility": 9118, "mslp": 103090, "screenRelativeHumidity": 96.84, "feelsLikeTemp": 8.53, "uvIndex": 1, "probOfPrecipitation": 10, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 10, "probOfHeavyRain": 0, "probOfHail": 0, "probOfSferics": 0 }, { "time": "2024-02-17T18:00Z", "maxScreenAirTemp": 10.92, "minScreenAirTemp": 10.48, "max10mWindGust": 10.01, "significantWeatherCode": 8, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 4.22, "windDirectionFrom10m": 191, "windGustSpeed10m": 9.9, "visibility": 9579, "mslp": 103021, "screenRelativeHumidity": 90.49, "feelsLikeTemp": 8.57, "uvIndex": 0, "probOfPrecipitation": 13, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 13, "probOfHeavyRain": 3, "probOfHail": 0, "probOfSferics": 0 }, { "time": "2024-02-17T21:00Z", "maxScreenAirTemp": 11.21, "minScreenAirTemp": 10.58, "max10mWindGust": 12.91, "significantWeatherCode": 15, "totalPrecipAmount": 0.11, "totalSnowAmount": 0, "windSpeed10m": 5.81, "windDirectionFrom10m": 198, "windGustSpeed10m": 12.82, "visibility": 11035, "mslp": 102910, "screenRelativeHumidity": 88.83, "feelsLikeTemp": 8.55, "uvIndex": 0, "probOfPrecipitation": 94, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 94, "probOfHeavyRain": 93, "probOfHail": 19, "probOfSferics": 9 }, { "time": "2024-02-18T00:00Z", "maxScreenAirTemp": 11.1, "minScreenAirTemp": 10.47, "max10mWindGust": 12.89, "significantWeatherCode": 15, "totalPrecipAmount": 5.75, "totalSnowAmount": 0, "windSpeed10m": 5.83, "windDirectionFrom10m": 217, "windGustSpeed10m": 12.74, "visibility": 4164, "mslp": 102782, "screenRelativeHumidity": 94.21, "feelsLikeTemp": 7.83, "uvIndex": 0, "probOfPrecipitation": 97, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 97, "probOfHeavyRain": 96, "probOfHail": 19, "probOfSferics": 10 }, { "time": "2024-02-18T03:00Z", "maxScreenAirTemp": 10.53, "minScreenAirTemp": 10.11, "max10mWindGust": 12.75, "significantWeatherCode": 15, "totalPrecipAmount": 6.38, "totalSnowAmount": 0, "windSpeed10m": 4.95, "windDirectionFrom10m": 229, "windGustSpeed10m": 10.92, "visibility": 5768, "mslp": 102618, "screenRelativeHumidity": 95.9, "feelsLikeTemp": 7.79, "uvIndex": 0, "probOfPrecipitation": 97, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 97, "probOfHeavyRain": 97, "probOfHail": 20, "probOfSferics": 10 }, { "time": "2024-02-18T06:00Z", "maxScreenAirTemp": 10.16, "minScreenAirTemp": 10.06, "max10mWindGust": 10.65, "significantWeatherCode": 15, "totalPrecipAmount": 3.37, "totalSnowAmount": 0, "windSpeed10m": 3.51, "windDirectionFrom10m": 243, "windGustSpeed10m": 7.9, "visibility": 19831, "mslp": 102519, "screenRelativeHumidity": 96.87, "feelsLikeTemp": 8.48, "uvIndex": 0, "probOfPrecipitation": 90, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 90, "probOfHeavyRain": 88, "probOfHail": 18, "probOfSferics": 12 }, { "time": "2024-02-18T09:00Z", "maxScreenAirTemp": 10.69, "minScreenAirTemp": 10.14, "max10mWindGust": 7.51, "significantWeatherCode": 12, "totalPrecipAmount": 1.05, "totalSnowAmount": 0, "windSpeed10m": 2.34, "windDirectionFrom10m": 250, "windGustSpeed10m": 5.75, "visibility": 9319, "mslp": 102513, "screenRelativeHumidity": 98.27, "feelsLikeTemp": 9.86, "uvIndex": 1, "probOfPrecipitation": 52, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 52, "probOfHeavyRain": 32, "probOfHail": 3, "probOfSferics": 1 }, { "time": "2024-02-18T12:00Z", "maxScreenAirTemp": 13.18, "minScreenAirTemp": 10.69, "max10mWindGust": 7.44, "significantWeatherCode": 7, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 3.99, "windDirectionFrom10m": 297, "windGustSpeed10m": 7.44, "visibility": 25301, "mslp": 102620, "screenRelativeHumidity": 86.89, "feelsLikeTemp": 11.57, "uvIndex": 1, "probOfPrecipitation": 11, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 11, "probOfHeavyRain": 6, "probOfHail": 1, "probOfSferics": 1 }, { "time": "2024-02-18T15:00Z", "maxScreenAirTemp": 13.65, "minScreenAirTemp": 13.12, "max10mWindGust": 7.92, "significantWeatherCode": 3, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 3.93, "windDirectionFrom10m": 297, "windGustSpeed10m": 7.45, "visibility": 29088, "mslp": 102627, "screenRelativeHumidity": 75.69, "feelsLikeTemp": 11.95, "uvIndex": 1, "probOfPrecipitation": 3, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 3, "probOfHeavyRain": 2, "probOfHail": 0, "probOfSferics": 0 }, { "time": "2024-02-18T18:00Z", "maxScreenAirTemp": 13.52, "minScreenAirTemp": 10.8, "max10mWindGust": 7.29, "significantWeatherCode": 2, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 2.14, "windDirectionFrom10m": 287, "windGustSpeed10m": 6.16, "visibility": 21358, "mslp": 102800, "screenRelativeHumidity": 89.42, "feelsLikeTemp": 10.28, "uvIndex": 0, "probOfPrecipitation": 2, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 2, "probOfHeavyRain": 2, "probOfHail": 0, "probOfSferics": 0 }, { "time": "2024-02-18T21:00Z", "maxScreenAirTemp": 11.01, "minScreenAirTemp": 9.88, "max10mWindGust": 7.24, "significantWeatherCode": 2, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 2.59, "windDirectionFrom10m": 282, "windGustSpeed10m": 6.65, "visibility": 19012, "mslp": 102967, "screenRelativeHumidity": 92.62, "feelsLikeTemp": 8.71, "uvIndex": 0, "probOfPrecipitation": 1, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 1, "probOfHeavyRain": 0, "probOfHail": 0, "probOfSferics": 0 }, { "time": "2024-02-19T00:00Z", "maxScreenAirTemp": 9.91, "minScreenAirTemp": 9.04, "max10mWindGust": 7.07, "significantWeatherCode": 7, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 2.81, "windDirectionFrom10m": 282, "windGustSpeed10m": 6.48, "visibility": 17411, "mslp": 103035, "screenRelativeHumidity": 94.29, "feelsLikeTemp": 7.51, "uvIndex": 0, "probOfPrecipitation": 4, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 4, "probOfHeavyRain": 0, "probOfHail": 0, "probOfSferics": 0 }, { "time": "2024-02-19T03:00Z", "maxScreenAirTemp": 9.05, "minScreenAirTemp": 8.24, "max10mWindGust": 7.07, "significantWeatherCode": 7, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 2.33, "windDirectionFrom10m": 273, "windGustSpeed10m": 5.44, "visibility": 16944, "mslp": 103012, "screenRelativeHumidity": 95.46, "feelsLikeTemp": 6.97, "uvIndex": 0, "probOfPrecipitation": 4, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 4, "probOfHeavyRain": 0, "probOfHail": 0, "probOfSferics": 0 }, { "time": "2024-02-19T06:00Z", "maxScreenAirTemp": 8.27, "minScreenAirTemp": 7.56, "max10mWindGust": 7.47, "significantWeatherCode": 8, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 3.33, "windDirectionFrom10m": 258, "windGustSpeed10m": 6.86, "visibility": 20004, "mslp": 102970, "screenRelativeHumidity": 94.27, "feelsLikeTemp": 5.54, "uvIndex": 0, "probOfPrecipitation": 10, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 10, "probOfHeavyRain": 1, "probOfHail": 0, "probOfSferics": 0 }, { "time": "2024-02-19T09:00Z", "maxScreenAirTemp": 8.94, "minScreenAirTemp": 7.65, "max10mWindGust": 9.55, "significantWeatherCode": 7, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 4.71, "windDirectionFrom10m": 264, "windGustSpeed10m": 8.92, "visibility": 12932, "mslp": 102970, "screenRelativeHumidity": 88.85, "feelsLikeTemp": 6.39, "uvIndex": 1, "probOfPrecipitation": 52, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 52, "probOfHeavyRain": 30, "probOfHail": 2, "probOfSferics": 1 }, { "time": "2024-02-19T12:00Z", "maxScreenAirTemp": 10.71, "minScreenAirTemp": 8.93, "max10mWindGust": 10.18, "significantWeatherCode": 7, "totalPrecipAmount": 0.09, "totalSnowAmount": 0, "windSpeed10m": 5.29, "windDirectionFrom10m": 278, "windGustSpeed10m": 10.18, "visibility": 24236, "mslp": 102917, "screenRelativeHumidity": 82.57, "feelsLikeTemp": 8.2, "uvIndex": 1, "probOfPrecipitation": 13, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 13, "probOfHeavyRain": 5, "probOfHail": 0, "probOfSferics": 1 }, { "time": "2024-02-19T15:00Z", "maxScreenAirTemp": 12.13, "minScreenAirTemp": 10.64, "max10mWindGust": 11.16, "significantWeatherCode": 3, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 5.06, "windDirectionFrom10m": 309, "windGustSpeed10m": 9.66, "visibility": 34168, "mslp": 102889, "screenRelativeHumidity": 65.14, "feelsLikeTemp": 9.69, "uvIndex": 1, "probOfPrecipitation": 4, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 4, "probOfHeavyRain": 2, "probOfHail": 0, "probOfSferics": 0 }, { "time": "2024-02-19T18:00Z", "maxScreenAirTemp": 11.98, "minScreenAirTemp": 8.91, "max10mWindGust": 10.5, "significantWeatherCode": 0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 3.27, "windDirectionFrom10m": 299, "windGustSpeed10m": 6.36, "visibility": 29205, "mslp": 103024, "screenRelativeHumidity": 77.5, "feelsLikeTemp": 7.11, "uvIndex": 0, "probOfPrecipitation": 1, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 1, "probOfHeavyRain": 0, "probOfHail": 0, "probOfSferics": 0 }, { "time": "2024-02-19T21:00Z", "maxScreenAirTemp": 9.04, "minScreenAirTemp": 6.96, "max10mWindGust": 7.08, "significantWeatherCode": 7, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 3.06, "windDirectionFrom10m": 298, "windGustSpeed10m": 5.3, "visibility": 26260, "mslp": 103122, "screenRelativeHumidity": 85.18, "feelsLikeTemp": 4.87, "uvIndex": 0, "probOfPrecipitation": 4, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 4, "probOfHeavyRain": 0, "probOfHail": 0, "probOfSferics": 0 }, { "time": "2024-02-20T00:00Z", "maxScreenAirTemp": 7.06, "minScreenAirTemp": 5.8, "max10mWindGust": 6.14, "significantWeatherCode": 7, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 2.59, "windDirectionFrom10m": 296, "windGustSpeed10m": 4.49, "visibility": 23913, "mslp": 103122, "screenRelativeHumidity": 89.64, "feelsLikeTemp": 3.88, "uvIndex": 0, "probOfPrecipitation": 4, "probOfSnow": 1, "probOfHeavySnow": 0, "probOfRain": 4, "probOfHeavyRain": 0, "probOfHail": 0, "probOfSferics": 0 }, { "time": "2024-02-20T03:00Z", "maxScreenAirTemp": 5.85, "minScreenAirTemp": 4.32, "max10mWindGust": 5.69, "significantWeatherCode": 7, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 2.47, "windDirectionFrom10m": 266, "windGustSpeed10m": 3.93, "visibility": 20523, "mslp": 103057, "screenRelativeHumidity": 94.0, "feelsLikeTemp": 2.36, "uvIndex": 0, "probOfPrecipitation": 5, "probOfSnow": 1, "probOfHeavySnow": 0, "probOfRain": 5, "probOfHeavyRain": 0, "probOfHail": 0, "probOfSferics": 0 }, { "time": "2024-02-20T06:00Z", "maxScreenAirTemp": 5.65, "minScreenAirTemp": 4.45, "max10mWindGust": 5.62, "significantWeatherCode": 7, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 2.92, "windDirectionFrom10m": 233, "windGustSpeed10m": 5.24, "visibility": 17975, "mslp": 102979, "screenRelativeHumidity": 94.91, "feelsLikeTemp": 2.75, "uvIndex": 0, "probOfPrecipitation": 5, "probOfSnow": 1, "probOfHeavySnow": 0, "probOfRain": 5, "probOfHeavyRain": 0, "probOfHail": 0, "probOfSferics": 0 }, { "time": "2024-02-20T09:00Z", "maxScreenAirTemp": 8.11, "minScreenAirTemp": 5.04, "max10mWindGust": 9.74, "significantWeatherCode": 7, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 4.63, "windDirectionFrom10m": 225, "windGustSpeed10m": 8.8, "visibility": 20465, "mslp": 102896, "screenRelativeHumidity": 91.17, "feelsLikeTemp": 5.48, "uvIndex": 1, "probOfPrecipitation": 6, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 6, "probOfHeavyRain": 0, "probOfHail": 0, "probOfSferics": 0 }, { "time": "2024-02-20T12:00Z", "maxScreenAirTemp": 10.42, "minScreenAirTemp": 8.11, "max10mWindGust": 13.83, "significantWeatherCode": 7, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 7.16, "windDirectionFrom10m": 230, "windGustSpeed10m": 13.73, "visibility": 24484, "mslp": 102757, "screenRelativeHumidity": 81.96, "feelsLikeTemp": 7.33, "uvIndex": 1, "probOfPrecipitation": 6, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 6, "probOfHeavyRain": 0, "probOfHail": 0, "probOfSferics": 0 }, { "time": "2024-02-20T15:00Z", "maxScreenAirTemp": 10.41, "minScreenAirTemp": 10.17, "max10mWindGust": 16.04, "significantWeatherCode": 7, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 7.58, "windDirectionFrom10m": 229, "windGustSpeed10m": 14.32, "visibility": 21127, "mslp": 102515, "screenRelativeHumidity": 85.35, "feelsLikeTemp": 7.05, "uvIndex": 1, "probOfPrecipitation": 6, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 6, "probOfHeavyRain": 1, "probOfHail": 0, "probOfSferics": 0 }, { "time": "2024-02-20T18:00Z", "maxScreenAirTemp": 10.27, "minScreenAirTemp": 9.66, "max10mWindGust": 15.03, "significantWeatherCode": 8, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 7.12, "windDirectionFrom10m": 228, "windGustSpeed10m": 13.37, "visibility": 17884, "mslp": 102364, "screenRelativeHumidity": 89.82, "feelsLikeTemp": 6.52, "uvIndex": 0, "probOfPrecipitation": 13, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 13, "probOfHeavyRain": 3, "probOfHail": 0, "probOfSferics": 0 }, { "time": "2024-02-20T21:00Z", "maxScreenAirTemp": 9.74, "minScreenAirTemp": 9.68, "max10mWindGust": 15.84, "significantWeatherCode": 8, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 6.94, "windDirectionFrom10m": 231, "windGustSpeed10m": 12.99, "visibility": 17806, "mslp": 102220, "screenRelativeHumidity": 90.71, "feelsLikeTemp": 6.58, "uvIndex": 0, "probOfPrecipitation": 19, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 19, "probOfHeavyRain": 8, "probOfHail": 1, "probOfSferics": 1 }, { "time": "2024-02-21T00:00Z", "maxScreenAirTemp": 9.8, "minScreenAirTemp": 9.54, "max10mWindGust": 13.74, "significantWeatherCode": 8, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 6.4, "windDirectionFrom10m": 232, "windGustSpeed10m": 11.87, "visibility": 15050, "mslp": 102019, "screenRelativeHumidity": 92.53, "feelsLikeTemp": 6.67, "uvIndex": 0, "probOfPrecipitation": 26, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 26, "probOfHeavyRain": 15, "probOfHail": 2, "probOfSferics": 1 }, { "time": "2024-02-21T03:00Z", "maxScreenAirTemp": 9.62, "minScreenAirTemp": 9.31, "max10mWindGust": 13.58, "significantWeatherCode": 12, "totalPrecipAmount": 0.47, "totalSnowAmount": 0, "windSpeed10m": 5.9, "windDirectionFrom10m": 228, "windGustSpeed10m": 10.84, "visibility": 10455, "mslp": 101768, "screenRelativeHumidity": 93.57, "feelsLikeTemp": 6.52, "uvIndex": 0, "probOfPrecipitation": 55, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 55, "probOfHeavyRain": 32, "probOfHail": 2, "probOfSferics": 1 }, { "time": "2024-02-21T06:00Z", "maxScreenAirTemp": 9.34, "minScreenAirTemp": 8.97, "max10mWindGust": 12.06, "significantWeatherCode": 15, "totalPrecipAmount": 1.04, "totalSnowAmount": 0, "windSpeed10m": 6.04, "windDirectionFrom10m": 213, "windGustSpeed10m": 11.11, "visibility": 7726, "mslp": 101529, "screenRelativeHumidity": 93.56, "feelsLikeTemp": 6.11, "uvIndex": 0, "probOfPrecipitation": 84, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 84, "probOfHeavyRain": 79, "probOfHail": 15, "probOfSferics": 8 }, { "time": "2024-02-21T09:00Z", "maxScreenAirTemp": 9.34, "minScreenAirTemp": 9.02, "max10mWindGust": 13.95, "significantWeatherCode": 15, "totalPrecipAmount": 2.02, "totalSnowAmount": 0, "windSpeed10m": 7.31, "windDirectionFrom10m": 207, "windGustSpeed10m": 13.69, "visibility": 6769, "mslp": 101264, "screenRelativeHumidity": 92.54, "feelsLikeTemp": 6.09, "uvIndex": 1, "probOfPrecipitation": 85, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 85, "probOfHeavyRain": 82, "probOfHail": 16, "probOfSferics": 8 }, { "time": "2024-02-21T12:00Z", "maxScreenAirTemp": 9.96, "minScreenAirTemp": 9.32, "max10mWindGust": 16.28, "significantWeatherCode": 15, "totalPrecipAmount": 2.06, "totalSnowAmount": 0, "windSpeed10m": 8.38, "windDirectionFrom10m": 206, "windGustSpeed10m": 15.83, "visibility": 7351, "mslp": 100933, "screenRelativeHumidity": 90.56, "feelsLikeTemp": 6.52, "uvIndex": 1, "probOfPrecipitation": 86, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 86, "probOfHeavyRain": 82, "probOfHail": 16, "probOfSferics": 8 }, { "time": "2024-02-21T15:00Z", "maxScreenAirTemp": 10.39, "minScreenAirTemp": 9.93, "max10mWindGust": 17.58, "significantWeatherCode": 15, "totalPrecipAmount": 1.85, "totalSnowAmount": 0, "windSpeed10m": 8.41, "windDirectionFrom10m": 211, "windGustSpeed10m": 15.81, "visibility": 8521, "mslp": 100550, "screenRelativeHumidity": 90.45, "feelsLikeTemp": 6.89, "uvIndex": 1, "probOfPrecipitation": 83, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 83, "probOfHeavyRain": 78, "probOfHail": 15, "probOfSferics": 8 }, { "time": "2024-02-21T18:00Z", "maxScreenAirTemp": 10.33, "minScreenAirTemp": 10.08, "max10mWindGust": 17.02, "significantWeatherCode": 15, "totalPrecipAmount": 1.55, "totalSnowAmount": 0, "windSpeed10m": 7.78, "windDirectionFrom10m": 215, "windGustSpeed10m": 14.46, "visibility": 9682, "mslp": 100328, "screenRelativeHumidity": 92.32, "feelsLikeTemp": 6.98, "uvIndex": 0, "probOfPrecipitation": 78, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 78, "probOfHeavyRain": 73, "probOfHail": 14, "probOfSferics": 7 }, { "time": "2024-02-21T21:00Z", "maxScreenAirTemp": 10.24, "minScreenAirTemp": 10.14, "max10mWindGust": 16.36, "significantWeatherCode": 12, "totalPrecipAmount": 0.96, "totalSnowAmount": 0, "windSpeed10m": 6.97, "windDirectionFrom10m": 226, "windGustSpeed10m": 12.85, "visibility": 12699, "mslp": 100164, "screenRelativeHumidity": 93.13, "feelsLikeTemp": 7.16, "uvIndex": 0, "probOfPrecipitation": 52, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 52, "probOfHeavyRain": 33, "probOfHail": 3, "probOfSferics": 2 }, { "time": "2024-02-22T00:00Z", "maxScreenAirTemp": 10.18, "minScreenAirTemp": 9.7, "max10mWindGust": 14.35, "significantWeatherCode": 8, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 6.06, "windDirectionFrom10m": 228, "windGustSpeed10m": 11.11, "visibility": 11329, "mslp": 99968, "screenRelativeHumidity": 93.31, "feelsLikeTemp": 6.98, "uvIndex": 0, "probOfPrecipitation": 23, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 23, "probOfHeavyRain": 12, "probOfHail": 2, "probOfSferics": 1 }, { "time": "2024-02-22T03:00Z", "maxScreenAirTemp": 9.77, "minScreenAirTemp": 9.47, "max10mWindGust": 13.64, "significantWeatherCode": 12, "totalPrecipAmount": 0.59, "totalSnowAmount": 0, "windSpeed10m": 5.82, "windDirectionFrom10m": 222, "windGustSpeed10m": 10.68, "visibility": 11002, "mslp": 99689, "screenRelativeHumidity": 93.29, "feelsLikeTemp": 6.78, "uvIndex": 0, "probOfPrecipitation": 46, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 46, "probOfHeavyRain": 25, "probOfHail": 1, "probOfSferics": 1 }, { "time": "2024-02-22T06:00Z", "maxScreenAirTemp": 9.69, "minScreenAirTemp": 9.45, "max10mWindGust": 12.65, "significantWeatherCode": 8, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 6.02, "windDirectionFrom10m": 211, "windGustSpeed10m": 11.2, "visibility": 10456, "mslp": 99392, "screenRelativeHumidity": 93.57, "feelsLikeTemp": 6.72, "uvIndex": 0, "probOfPrecipitation": 24, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 24, "probOfHeavyRain": 14, "probOfHail": 2, "probOfSferics": 1 }, { "time": "2024-02-22T09:00Z", "maxScreenAirTemp": 9.84, "minScreenAirTemp": 9.53, "max10mWindGust": 14.46, "significantWeatherCode": 15, "totalPrecipAmount": 1.11, "totalSnowAmount": 0, "windSpeed10m": 6.77, "windDirectionFrom10m": 207, "windGustSpeed10m": 12.65, "visibility": 10933, "mslp": 99076, "screenRelativeHumidity": 92.04, "feelsLikeTemp": 6.78, "uvIndex": 1, "probOfPrecipitation": 71, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 71, "probOfHeavyRain": 67, "probOfHail": 13, "probOfSferics": 7 }, { "time": "2024-02-22T12:00Z", "maxScreenAirTemp": 10.49, "minScreenAirTemp": 9.8, "max10mWindGust": 16.89, "significantWeatherCode": 14, "totalPrecipAmount": 1.44, "totalSnowAmount": 0, "windSpeed10m": 8.32, "windDirectionFrom10m": 215, "windGustSpeed10m": 15.92, "visibility": 13595, "mslp": 98762, "screenRelativeHumidity": 87.24, "feelsLikeTemp": 6.86, "uvIndex": 1, "probOfPrecipitation": 62, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 61, "probOfHeavyRain": 57, "probOfHail": 12, "probOfSferics": 11 }, { "time": "2024-02-22T15:00Z", "maxScreenAirTemp": 10.31, "minScreenAirTemp": 9.72, "max10mWindGust": 19.52, "significantWeatherCode": 14, "totalPrecipAmount": 1.48, "totalSnowAmount": 0, "windSpeed10m": 9.04, "windDirectionFrom10m": 223, "windGustSpeed10m": 17.18, "visibility": 14585, "mslp": 98434, "screenRelativeHumidity": 82.96, "feelsLikeTemp": 6.07, "uvIndex": 1, "probOfPrecipitation": 62, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 61, "probOfHeavyRain": 57, "probOfHail": 12, "probOfSferics": 12 }, { "time": "2024-02-22T18:00Z", "maxScreenAirTemp": 9.82, "minScreenAirTemp": 7.61, "max10mWindGust": 19.28, "significantWeatherCode": 9, "totalPrecipAmount": 1.11, "totalSnowAmount": 0, "windSpeed10m": 7.91, "windDirectionFrom10m": 239, "windGustSpeed10m": 14.42, "visibility": 20148, "mslp": 98434, "screenRelativeHumidity": 79.36, "feelsLikeTemp": 3.74, "uvIndex": 0, "probOfPrecipitation": 44, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 44, "probOfHeavyRain": 32, "probOfHail": 4, "probOfSferics": 6 }, { "time": "2024-02-22T21:00Z", "maxScreenAirTemp": 7.69, "minScreenAirTemp": 6.05, "max10mWindGust": 16.16, "significantWeatherCode": 0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 7.38, "windDirectionFrom10m": 249, "windGustSpeed10m": 13.14, "visibility": 23784, "mslp": 98597, "screenRelativeHumidity": 77.6, "feelsLikeTemp": 1.88, "uvIndex": 0, "probOfPrecipitation": 12, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 12, "probOfHeavyRain": 10, "probOfHail": 2, "probOfSferics": 1 }, { "time": "2024-02-23T00:00Z", "maxScreenAirTemp": 6.1, "minScreenAirTemp": 5.22, "max10mWindGust": 14.6, "significantWeatherCode": 0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 6.61, "windDirectionFrom10m": 245, "windGustSpeed10m": 11.58, "visibility": 25279, "mslp": 98742, "screenRelativeHumidity": 77.46, "feelsLikeTemp": 1.2, "uvIndex": 0, "probOfPrecipitation": 8, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 8, "probOfHeavyRain": 5, "probOfHail": 1, "probOfSferics": 1 }, { "time": "2024-02-23T03:00Z", "maxScreenAirTemp": 5.42, "minScreenAirTemp": 5.18, "max10mWindGust": 13.07, "significantWeatherCode": 0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 6.22, "windDirectionFrom10m": 237, "windGustSpeed10m": 10.91, "visibility": 24397, "mslp": 98771, "screenRelativeHumidity": 79.47, "feelsLikeTemp": 1.25, "uvIndex": 0, "probOfPrecipitation": 5, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 5, "probOfHeavyRain": 4, "probOfHail": 1, "probOfSferics": 1 }, { "time": "2024-02-23T06:00Z", "maxScreenAirTemp": 5.39, "minScreenAirTemp": 5.13, "max10mWindGust": 12.51, "significantWeatherCode": 7, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 5.96, "windDirectionFrom10m": 232, "windGustSpeed10m": 10.43, "visibility": 23385, "mslp": 98811, "screenRelativeHumidity": 81.65, "feelsLikeTemp": 1.36, "uvIndex": 0, "probOfPrecipitation": 10, "probOfSnow": 1, "probOfHeavySnow": 0, "probOfRain": 10, "probOfHeavyRain": 5, "probOfHail": 1, "probOfSferics": 1 }, { "time": "2024-02-23T09:00Z", "maxScreenAirTemp": 6.69, "minScreenAirTemp": 5.26, "max10mWindGust": 12.62, "significantWeatherCode": 1, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 6.33, "windDirectionFrom10m": 228, "windGustSpeed10m": 11.6, "visibility": 23165, "mslp": 98890, "screenRelativeHumidity": 78.08, "feelsLikeTemp": 2.96, "uvIndex": 1, "probOfPrecipitation": 10, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 10, "probOfHeavyRain": 6, "probOfHail": 1, "probOfSferics": 1 }, { "time": "2024-02-23T12:00Z", "maxScreenAirTemp": 7.99, "minScreenAirTemp": 6.64, "max10mWindGust": 14.79, "significantWeatherCode": 14, "totalPrecipAmount": 0.95, "totalSnowAmount": 0, "windSpeed10m": 7.11, "windDirectionFrom10m": 231, "windGustSpeed10m": 13.38, "visibility": 23049, "mslp": 98974, "screenRelativeHumidity": 73.25, "feelsLikeTemp": 3.88, "uvIndex": 2, "probOfPrecipitation": 52, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 52, "probOfHeavyRain": 48, "probOfHail": 10, "probOfSferics": 11 }, { "time": "2024-02-23T15:00Z", "maxScreenAirTemp": 8.11, "minScreenAirTemp": 7.61, "max10mWindGust": 14.99, "significantWeatherCode": 10, "totalPrecipAmount": 0.67, "totalSnowAmount": 0, "windSpeed10m": 6.59, "windDirectionFrom10m": 230, "windGustSpeed10m": 12.43, "visibility": 23824, "mslp": 99018, "screenRelativeHumidity": 71.06, "feelsLikeTemp": 4.42, "uvIndex": 1, "probOfPrecipitation": 34, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 34, "probOfHeavyRain": 20, "probOfHail": 1, "probOfSferics": 4 }, { "time": "2024-02-23T18:00Z", "maxScreenAirTemp": 7.88, "minScreenAirTemp": 6.36, "max10mWindGust": 13.18, "significantWeatherCode": 0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 5.1, "windDirectionFrom10m": 228, "windGustSpeed10m": 8.88, "visibility": 24021, "mslp": 99142, "screenRelativeHumidity": 78.49, "feelsLikeTemp": 3.13, "uvIndex": 0, "probOfPrecipitation": 7, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 7, "probOfHeavyRain": 4, "probOfHail": 0, "probOfSferics": 1 }, { "time": "2024-02-23T21:00Z", "maxScreenAirTemp": 6.4, "minScreenAirTemp": 5.49, "max10mWindGust": 9.53, "significantWeatherCode": 7, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 4.55, "windDirectionFrom10m": 233, "windGustSpeed10m": 7.87, "visibility": 23349, "mslp": 99270, "screenRelativeHumidity": 82.54, "feelsLikeTemp": 2.42, "uvIndex": 0, "probOfPrecipitation": 9, "probOfSnow": 1, "probOfHeavySnow": 0, "probOfRain": 9, "probOfHeavyRain": 4, "probOfHail": 0, "probOfSferics": 1 }, { "time": "2024-02-24T00:00Z", "maxScreenAirTemp": 5.59, "minScreenAirTemp": 4.77, "max10mWindGust": 8.74, "significantWeatherCode": 0, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 4.2, "windDirectionFrom10m": 232, "windGustSpeed10m": 7.16, "visibility": 22325, "mslp": 99365, "screenRelativeHumidity": 85.83, "feelsLikeTemp": 1.8, "uvIndex": 0, "probOfPrecipitation": 7, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 6, "probOfHeavyRain": 4, "probOfHail": 0, "probOfSferics": 1 }, { "time": "2024-02-24T03:00Z", "maxScreenAirTemp": 4.92, "minScreenAirTemp": 4.42, "max10mWindGust": 8.5, "significantWeatherCode": 7, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 4.23, "windDirectionFrom10m": 238, "windGustSpeed10m": 7.16, "visibility": 20772, "mslp": 99430, "screenRelativeHumidity": 87.91, "feelsLikeTemp": 1.28, "uvIndex": 0, "probOfPrecipitation": 8, "probOfSnow": 1, "probOfHeavySnow": 1, "probOfRain": 8, "probOfHeavyRain": 4, "probOfHail": 1, "probOfSferics": 1 }, { "time": "2024-02-24T06:00Z", "maxScreenAirTemp": 4.49, "minScreenAirTemp": 3.86, "max10mWindGust": 8.07, "significantWeatherCode": 2, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 4.09, "windDirectionFrom10m": 235, "windGustSpeed10m": 6.85, "visibility": 20467, "mslp": 99535, "screenRelativeHumidity": 89.35, "feelsLikeTemp": 0.74, "uvIndex": 0, "probOfPrecipitation": 7, "probOfSnow": 1, "probOfHeavySnow": 1, "probOfRain": 6, "probOfHeavyRain": 3, "probOfHail": 1, "probOfSferics": 1 }, { "time": "2024-02-24T09:00Z", "maxScreenAirTemp": 6.32, "minScreenAirTemp": 3.95, "max10mWindGust": 8.97, "significantWeatherCode": 7, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 4.86, "windDirectionFrom10m": 236, "windGustSpeed10m": 8.91, "visibility": 23436, "mslp": 99655, "screenRelativeHumidity": 81.66, "feelsLikeTemp": 3.25, "uvIndex": 1, "probOfPrecipitation": 9, "probOfSnow": 1, "probOfHeavySnow": 1, "probOfRain": 9, "probOfHeavyRain": 4, "probOfHail": 0, "probOfSferics": 1 }, { "time": "2024-02-24T12:00Z", "maxScreenAirTemp": 8.36, "minScreenAirTemp": 6.32, "max10mWindGust": 11.98, "significantWeatherCode": 7, "totalPrecipAmount": 0.0, "totalSnowAmount": 0, "windSpeed10m": 5.91, "windDirectionFrom10m": 234, "windGustSpeed10m": 11.62, "visibility": 22370, "mslp": 99735, "screenRelativeHumidity": 70.47, "feelsLikeTemp": 5.17, "uvIndex": 2, "probOfPrecipitation": 13, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 13, "probOfHeavyRain": 6, "probOfHail": 1, "probOfSferics": 1 }, { "time": "2024-02-24T15:00Z", "maxScreenAirTemp": 8.25, "minScreenAirTemp": 7.96, "max10mWindGust": 12.77, "significantWeatherCode": 10, "totalPrecipAmount": 0.58, "totalSnowAmount": 0, "windSpeed10m": 5.98, "windDirectionFrom10m": 228, "windGustSpeed10m": 11.48, "visibility": 22483, "mslp": 99725, "screenRelativeHumidity": 72.01, "feelsLikeTemp": 4.97, "uvIndex": 1, "probOfPrecipitation": 32, "probOfSnow": 0, "probOfHeavySnow": 0, "probOfRain": 32, "probOfHeavyRain": 17, "probOfHail": 1, "probOfSferics": 3 }] } }] } datapoint-python-0.13.0/tests/unit/000077500000000000000000000000001474201672100172225ustar00rootroot00000000000000datapoint-python-0.13.0/tests/unit/__init__.py000066400000000000000000000000001474201672100213210ustar00rootroot00000000000000datapoint-python-0.13.0/tests/unit/test_forecast.py000066400000000000000000000351261474201672100224500ustar00rootroot00000000000000import datetime import geojson import pytest import tests.reference_data.reference_data_test_forecast as reference_data_test_forecast from datapoint import Forecast from datapoint.exceptions import APIException # TODO look into pytest-cases. Should reduce the amount of stored data structures @pytest.fixture def load_hourly_json(): with open("./tests/reference_data/hourly_api_data.json") as f: my_json = geojson.load(f) return my_json @pytest.fixture def load_daily_json(): with open("./tests/reference_data/daily_api_data.json") as f: my_json = geojson.load(f) return my_json @pytest.fixture def load_three_hourly_json(): with open("./tests/reference_data/three_hourly_api_data.json") as f: my_json = geojson.load(f) return my_json @pytest.fixture def daily_forecast(load_daily_json): return Forecast.Forecast("daily", load_daily_json, convert_weather_code=True) @pytest.fixture def daily_forecast_raw_weather_code(load_daily_json): return Forecast.Forecast("daily", load_daily_json, convert_weather_code=False) @pytest.fixture def twice_daily_forecast(load_daily_json): return Forecast.Forecast("twice-daily", load_daily_json, convert_weather_code=True) @pytest.fixture def twice_daily_forecast_raw_weather_code(load_daily_json): return Forecast.Forecast("twice-daily", load_daily_json, convert_weather_code=False) @pytest.fixture def hourly_forecast(load_hourly_json): return Forecast.Forecast("hourly", load_hourly_json, convert_weather_code=True) @pytest.fixture def hourly_forecast_raw_weather_code(load_hourly_json): return Forecast.Forecast("hourly", load_hourly_json, convert_weather_code=False) @pytest.fixture def three_hourly_forecast(load_three_hourly_json): return Forecast.Forecast( "three-hourly", load_three_hourly_json, convert_weather_code=True ) @pytest.fixture def hourly_first_forecast_and_parameters(load_hourly_json): parameters = load_hourly_json["parameters"][0] forecast = load_hourly_json["features"][0]["properties"]["timeSeries"][0] return (forecast, parameters) @pytest.fixture def three_hourly_first_forecast_and_parameters(load_three_hourly_json): parameters = load_three_hourly_json["parameters"][0] forecast = load_three_hourly_json["features"][0]["properties"]["timeSeries"][0] return (forecast, parameters) @pytest.fixture def expected_first_hourly_timestep(): return reference_data_test_forecast.EXPECTED_FIRST_HOURLY_TIMESTEP @pytest.fixture def expected_first_hourly_timestep_raw_weather_code(): return reference_data_test_forecast.EXPECTED_FIRST_HOURLY_TIMESTEP_RAW_WEATHER_CODE @pytest.fixture def expected_at_datetime_hourly_timestep(): return reference_data_test_forecast.EXPECTED_AT_DATETIME_HOURLY_TIMESTEP @pytest.fixture def expected_at_datetime_hourly_final_timestep(): return reference_data_test_forecast.EXPECTED_AT_DATETIME_HOURLY_FINAL_TIMESTEP @pytest.fixture def expected_first_daily_timestep(): return reference_data_test_forecast.EXPECTED_FIRST_DAILY_TIMESTEP @pytest.fixture def expected_first_daily_timestep_raw_weather_code(): return reference_data_test_forecast.EXPECTED_FIRST_DAILY_TIMESTEP_RAW_WEATHER_CODE @pytest.fixture def expected_at_datetime_daily_timestep(): return reference_data_test_forecast.EXPECTED_AT_DATETIME_DAILY_TIMESTEP @pytest.fixture def expected_at_datetime_daily_final_timestep(): return reference_data_test_forecast.EXPECTED_AT_DATETIME_DAILY_FINAL_TIMESTEP @pytest.fixture def expected_first_twice_daily_timestep(): return reference_data_test_forecast.EXPECTED_FIRST_TWICE_DAILY_TIMESTEP @pytest.fixture def expected_first_twice_daily_timestep_raw_weather_code(): return ( reference_data_test_forecast.EXPECTED_FIRST_TWICE_DAILY_TIMESTEP_RAW_WEATHER_CODE ) @pytest.fixture def expected_at_datetime_twice_daily_timestep(): return reference_data_test_forecast.EXPECTED_AT_DATETIME_TWICE_DAILY_TIMESTEP @pytest.fixture def expected_at_datetime_twice_daily_final_timestep(): return reference_data_test_forecast.EXPECTED_AT_DATETIME_TWICE_DAILY_FINAL_TIMESTEP @pytest.fixture def expected_first_three_hourly_timestep(): return reference_data_test_forecast.EXPECTED_FIRST_THREE_HOURLY_TIMESTEP @pytest.fixture def expected_at_datetime_three_hourly_timestep(): return reference_data_test_forecast.EXPECTED_AT_DATETIME_THREE_HOURLY_TIMESTEP @pytest.fixture def expected_at_datetime_three_hourly_final_timestep(): return reference_data_test_forecast.EXPECTED_AT_DATETIME_THREE_HOURLY_FINAL_TIMESTEP class TestHourlyForecast: def test_forecast_frequency(self, hourly_forecast): assert hourly_forecast.frequency == "hourly" def test_forecast_location_name(self, hourly_forecast): assert hourly_forecast.name == "Sheffield Park" def test_forecast_location_latitude(self, hourly_forecast): assert hourly_forecast.forecast_latitude == 50.9992 def test_forecast_location_longitude(self, hourly_forecast): assert hourly_forecast.forecast_longitude == 0.0154 def test_forecast_distance_from_request(self, hourly_forecast): assert hourly_forecast.distance_from_requested_location == 1081.5349 def test_forecast_elevation(self, hourly_forecast): assert hourly_forecast.elevation == 37.0 def test_forecast_first_timestep( self, hourly_forecast, expected_first_hourly_timestep ): assert hourly_forecast.timesteps[0] == expected_first_hourly_timestep def test_build_timestep( self, hourly_forecast, hourly_first_forecast_and_parameters, expected_first_hourly_timestep, ): built_timestep = hourly_forecast._build_timestep( hourly_first_forecast_and_parameters[0], hourly_first_forecast_and_parameters[1], ) assert built_timestep == expected_first_hourly_timestep def test_at_datetime(self, hourly_forecast, expected_at_datetime_hourly_timestep): ts = hourly_forecast.at_datetime(datetime.datetime(2024, 2, 16, 19, 15)) assert ts == expected_at_datetime_hourly_timestep def test_at_datetime_final_timestamp( self, hourly_forecast, expected_at_datetime_hourly_final_timestep ): ts = hourly_forecast.at_datetime(datetime.datetime(2024, 2, 17, 19, 20)) assert ts == expected_at_datetime_hourly_final_timestep def test_requested_time_too_early(self, hourly_forecast): with pytest.raises(APIException): hourly_forecast.at_datetime(datetime.datetime(2024, 2, 15, 18, 25)) def test_requested_time_too_late(self, hourly_forecast): with pytest.raises(APIException): hourly_forecast.at_datetime(datetime.datetime(2024, 2, 17, 19, 35)) def test_forecast_first_timestep_raw_weather_code( self, hourly_forecast_raw_weather_code, expected_first_hourly_timestep_raw_weather_code, ): assert ( hourly_forecast_raw_weather_code.timesteps[0] == expected_first_hourly_timestep_raw_weather_code ) class TestDailyForecast: def test_forecast_frequency(self, daily_forecast): assert daily_forecast.frequency == "daily" def test_forecast_location_name(self, daily_forecast): assert daily_forecast.name == "Sheffield Park" def test_forecast_location_latitude(self, daily_forecast): assert daily_forecast.forecast_latitude == 50.9992 def test_forecast_location_longitude(self, daily_forecast): assert daily_forecast.forecast_longitude == 0.0154 def test_forecast_distance_from_request(self, daily_forecast): assert daily_forecast.distance_from_requested_location == 1081.5349 def test_forecast_elevation(self, daily_forecast): assert daily_forecast.elevation == 37.0 def test_forecast_first_timestep( self, daily_forecast, expected_first_daily_timestep ): assert daily_forecast.timesteps[0] == expected_first_daily_timestep # Need a new test_build_timestep function here def test_build_timesteps( self, daily_forecast, load_daily_json, expected_first_daily_timestep ): timestep = daily_forecast._build_timestep( load_daily_json["features"][0]["properties"]["timeSeries"][0], load_daily_json["parameters"][0], ) assert timestep == expected_first_daily_timestep def test_at_datetime(self, daily_forecast, expected_at_datetime_daily_timestep): ts = daily_forecast.at_datetime(datetime.datetime(2024, 2, 16, 19, 15)) assert ts == expected_at_datetime_daily_timestep def test_at_datetime_final_timestamp( self, daily_forecast, expected_at_datetime_daily_final_timestep ): ts = daily_forecast.at_datetime(datetime.datetime(2024, 2, 17, 17)) assert ts == expected_at_datetime_daily_final_timestep def test_requested_time_too_early(self, daily_forecast): with pytest.raises(APIException): daily_forecast.at_datetime(datetime.datetime(2024, 2, 15, 17)) def test_requested_time_too_late(self, daily_forecast): with pytest.raises(APIException): daily_forecast.at_datetime(datetime.datetime(2024, 2, 23, 19)) def test_forecast_first_timestep_raw_weather_code( self, daily_forecast_raw_weather_code, expected_first_daily_timestep_raw_weather_code, ): assert ( daily_forecast_raw_weather_code.timesteps[0] == expected_first_daily_timestep_raw_weather_code ) class TestTwiceDailyForecast: def test_forecast_frequency(self, twice_daily_forecast): assert twice_daily_forecast.frequency == "twice-daily" def test_forecast_location_name(self, twice_daily_forecast): assert twice_daily_forecast.name == "Sheffield Park" def test_forecast_location_latitude(self, twice_daily_forecast): assert twice_daily_forecast.forecast_latitude == 50.9992 def test_forecast_location_longitude(self, twice_daily_forecast): assert twice_daily_forecast.forecast_longitude == 0.0154 def test_forecast_distance_from_request(self, twice_daily_forecast): assert twice_daily_forecast.distance_from_requested_location == 1081.5349 def test_forecast_elevation(self, twice_daily_forecast): assert twice_daily_forecast.elevation == 37.0 def test_forecast_first_timestep( self, twice_daily_forecast, expected_first_twice_daily_timestep ): assert twice_daily_forecast.timesteps[0] == expected_first_twice_daily_timestep # twice-daily forecasts take daily data from DataHub def test_build_twice_daily_timesteps( self, twice_daily_forecast, load_daily_json, expected_first_twice_daily_timestep ): timesteps = twice_daily_forecast._build_twice_daily_timesteps( load_daily_json["features"][0]["properties"]["timeSeries"], load_daily_json["parameters"][0], ) assert timesteps[0] == expected_first_twice_daily_timestep def test_at_datetime( self, twice_daily_forecast, expected_at_datetime_twice_daily_timestep ): ts = twice_daily_forecast.at_datetime(datetime.datetime(2024, 2, 16, 19, 15)) assert ts == expected_at_datetime_twice_daily_timestep def test_at_datetime_final_timestep( self, twice_daily_forecast, expected_at_datetime_twice_daily_final_timestep ): ts = twice_daily_forecast.at_datetime(datetime.datetime(2024, 2, 17, 17)) assert ts == expected_at_datetime_twice_daily_final_timestep def test_requested_time_too_early(self, twice_daily_forecast): with pytest.raises(APIException): twice_daily_forecast.at_datetime(datetime.datetime(2024, 2, 15, 17)) def test_requested_time_too_late(self, twice_daily_forecast): with pytest.raises(APIException): twice_daily_forecast.at_datetime(datetime.datetime(2024, 2, 23, 19)) def test_forecast_first_timestep_raw_weather_code( self, twice_daily_forecast_raw_weather_code, expected_first_twice_daily_timestep_raw_weather_code, ): print(twice_daily_forecast_raw_weather_code.timesteps[0]) assert ( twice_daily_forecast_raw_weather_code.timesteps[0] == expected_first_twice_daily_timestep_raw_weather_code ) class TestThreeHourlyForecast: def test_forecast_frequency(self, three_hourly_forecast): assert three_hourly_forecast.frequency == "three-hourly" def test_forecast_location_name(self, three_hourly_forecast): assert three_hourly_forecast.name == "Sheffield Park" def test_forecast_location_latitude(self, three_hourly_forecast): assert three_hourly_forecast.forecast_latitude == 50.9992 def test_forecast_location_longitude(self, three_hourly_forecast): assert three_hourly_forecast.forecast_longitude == 0.0154 def test_forecast_distance_from_request(self, three_hourly_forecast): assert three_hourly_forecast.distance_from_requested_location == 1081.5349 def test_forecast_elevation(self, three_hourly_forecast): assert three_hourly_forecast.elevation == 37.0 def test_forecast_first_timestep( self, three_hourly_forecast, expected_first_three_hourly_timestep ): assert ( three_hourly_forecast.timesteps[0] == expected_first_three_hourly_timestep ) def test_build_timestep( self, three_hourly_forecast, three_hourly_first_forecast_and_parameters, expected_first_three_hourly_timestep, ): built_timestep = three_hourly_forecast._build_timestep( three_hourly_first_forecast_and_parameters[0], three_hourly_first_forecast_and_parameters[1], ) assert built_timestep == expected_first_three_hourly_timestep def test_at_datetime( self, three_hourly_forecast, expected_at_datetime_three_hourly_timestep ): ts = three_hourly_forecast.at_datetime(datetime.datetime(2024, 2, 22, 19, 15)) assert ts == expected_at_datetime_three_hourly_timestep def test_at_datetime_final_timestamp( self, three_hourly_forecast, expected_at_datetime_three_hourly_final_timestep ): ts = three_hourly_forecast.at_datetime(datetime.datetime(2024, 2, 24, 16)) assert ts == expected_at_datetime_three_hourly_final_timestep def test_requested_time_too_early(self, three_hourly_forecast): with pytest.raises(APIException): three_hourly_forecast.at_datetime(datetime.datetime(2024, 2, 17, 13, 20)) def test_requested_time_too_late(self, three_hourly_forecast): with pytest.raises(APIException): three_hourly_forecast.at_datetime(datetime.datetime(2024, 2, 24, 17))