Add constants test

This commit is contained in:
arofarn 2021-06-28 12:52:08 +02:00
parent 35eb0ce59d
commit 0a7ed162d7
2 changed files with 20 additions and 6 deletions

View File

@ -28,9 +28,7 @@ Come without numpy, pint (units), matplotlib or other "big" library support.
As pint is not supported, the SI units are used. As pint is not supported, the SI units are used.
# Sources : Original project : `MetPy <https://unidata.github.io/MetPy/latest/index.html>`_
MetPy : https://unidata.github.io/MetPy/latest/index.html
Dependencies Dependencies
============= =============
@ -46,8 +44,14 @@ This is easily achieved by downloading
Usage Example Usage Example
============= =============
.. todo:: Add a quick, simple example. It and other examples should live in the .. code-block:: python3
examples folder and be included in docs/examples.rst.
import umetpy.constants
print("List of all constants:\n")
for cst in dir(umetpy.constants):
if cst[0] != "_":
print("{:25s} = {:f}".format(cst, eval("{}.{}".format("umetpy.constants", cst))))
Contributing Contributing
============ ============

View File

@ -1,4 +1,14 @@
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries # SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
# SPDX-FileCopyrightText: Copyright (c) 2021 Arofarn # SPDX-FileCopyrightText: Copyright (c) 2021 Arofarn
# #
# SPDX-License-Identifier: Unlicense # SPDX-License-Identifier: BSD-3-Clause
import umetpy.constants
# pylint: disable=eval-used
print("List of all constants:\n")
for cst in dir(umetpy.constants):
if cst[0] != "_":
print(
"{:25s} = {:f}".format(cst, eval("{}.{}".format("umetpy.constants", cst)))
)