Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

doc: remove legacy template file #604

Merged
merged 2 commits into from
Dec 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 26 additions & 27 deletions climada/util/coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,22 +290,26 @@ def dist_approx(lat1, lon1, lat2, lon2, log=False, normalize=True,
If False, assume that all longitudinal values lie within a single interval of size 360
(e.g., between -180 and 180, or between 0 and 360) and such that the shortest path between
any two points does not cross the antimeridian according to that parametrization. If True,
a suitable interval is determined using `lon_bounds` and the longitudinal values are
reparametrized accordingly using `lon_normalize`. Note that this option has no effect when
using the "geosphere" method because it is independent from the parametrization.
Default: True
a suitable interval is determined using :py:func:`lon_bounds` and the longitudinal values
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unrelated to the main issue in this PR. I was curious to test cross-references in docstrings.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... which doesn't make anything, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before:
image
After:
image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course it does! Sorry. (I looked at the wrong tab 🙄)

are reparametrized accordingly using :py:func:`lon_normalize`. Note that this option has
no effect when using the "geosphere" method because it is independent from the
parametrization. Default: True
method : str, optional
Specify an approximation method to use:
* "equirect": Distance according to sinusoidal projection. Fast, but inaccurate for
large distances and high latitudes.
* "geosphere": Exact spherical distance. Much more accurate at all distances, but slow.

* "equirect": Distance according to sinusoidal projection. Fast, but inaccurate for
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unrelated to the main issue in this PR. Correcting indentation and adding empty lines before and after bullet lists fixes a few sphinx warnings.

large distances and high latitudes.
* "geosphere": Exact spherical distance. Much more accurate at all distances, but slow.

Note that ellipsoidal distances would be even more accurate, but are currently not
implemented. Default: "equirect".
units : str, optional
Specify a unit for the distance. One of:
* "km": distance in km.
* "degree": angular distance in decimal degrees.
* "radian": angular distance in radians.

* "km": distance in km.
* "degree": angular distance in decimal degrees.
* "radian": angular distance in radians.

Default: "km".

Returns
Expand Down Expand Up @@ -373,14 +377,12 @@ def compute_geodesic_lengths(gdf):

See also
--------
* dist_approx() which also offers haversine distance calculation options
between specific points (not along any geometries however).
* interpolation.interpolate_lines()
:py:func:`dist_approx` : distance between individual lat/lon-points

Note
----
This implementation relies on non-projected (i.e. geographic coordinate
systems that span the entire globe) crs only, which results in
systems that span the entire globe) CRS only, which results in
sea-level distances and hence a certain (minor) level of distortion; cf.
https://gis.stackexchange.com/questions/176442/what-is-the-real-distance-between-positions
"""
Expand All @@ -393,10 +395,11 @@ def compute_geodesic_lengths(gdf):

def get_gridcellarea(lat, resolution=0.5, unit='ha'):
"""The area covered by a grid cell is calculated depending on the latitude
1 degree = ONE_LAT_KM (111.12km at the equator)
longitudal distance in km = ONE_LAT_KM*resolution*cos(lat)
latitudal distance in km = ONE_LAT_KM*resolution
area = longitudal distance * latitudal distance

* 1 degree = ONE_LAT_KM (111.12km at the equator)
* longitudal distance in km = ONE_LAT_KM*resolution*cos(lat)
* latitudal distance in km = ONE_LAT_KM*resolution
* area = longitudal distance * latitudal distance

Parameters
----------
Expand All @@ -406,7 +409,6 @@ def get_gridcellarea(lat, resolution=0.5, unit='ha'):
raster resolution in degree (default: 0.5 degree)
unit: string, optional
unit of the output area (default: ha, alternatives: m2, km2)

"""

if unit == 'm2':
Expand Down Expand Up @@ -1490,9 +1492,8 @@ def get_admin1_info(country_names):
----------
country_names : list or str
string or list with strings, either ISO code or names of countries, e.g.:
['ZWE', 'GBR', 'VNM', 'UZB', 'Kenya', '051']
For example, for Armenia, the following inputs work:
'Armenia', 'ARM', 'AM', '051', 51
``['ZWE', 'GBR', 'VNM', 'UZB', 'Kenya', '051']`` For example, for Armenia, all of the
following inputs work: ``'Armenia', 'ARM', 'AM', '051', 51``

Returns
-------
Expand Down Expand Up @@ -1549,11 +1550,9 @@ def get_admin1_geometries(countries):
Parameters
----------
countries : list or str or int
string or list containing strings, either ISO3 code or ISO2 code or names
names of countries, e.g.:
['ZWE', 'GBR', 'VNM', 'UZB', 'Kenya', '051']
For example, for Armenia, the following inputs work:
'Armenia', 'ARM', 'AM', '051', 51
string or list with strings, either ISO code or names of countries, e.g.:
``['ZWE', 'GBR', 'VNM', 'UZB', 'Kenya', '051']`` For example, for Armenia, all of the
following inputs work: ``'Armenia', 'ARM', 'AM', '051', 51``

Returns
-------
Expand Down
20 changes: 0 additions & 20 deletions doc/_templates/layout.html

This file was deleted.

8 changes: 0 additions & 8 deletions doc/climada/climada.util.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ climada\.util\.api\_client module
:undoc-members:
:show-inheritance:

climada\.util\.cached module
----------------------------

.. automodule:: climada.util.cached
:members:
:undoc-members:
:show-inheritance:

Comment on lines -12 to -19
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This submodule doesn't exist, hence we can remove the reference from the docs.

climada\.util\.checker module
-----------------------------

Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
read_docs_url = 'en/v{}/'.format(__version__)

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = []

# The suffix of source filenames.
source_suffix = {
Expand Down
2 changes: 1 addition & 1 deletion doc/guide/Guide_Git_Development.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
"source": [
"### Gitflow works on the `develop` branch instead of `main`\n",
"\n",
"![](flow_1.png)\n",
"![](img/flow_1.png)\n",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes an error/warning output of sphinx.

"\n",
"- The critical difference between Gitflow and 'standard' git is that almost all of your work takes place on the `develop` branch, instead of the `main` (formerly `master`) branch.\n",
"- The `main` branch is reserved for planned, stable product releases, and it's what the general public download when they install CLIMADA. The developers almost never interact with it."
Expand Down