Skip to content

Commit

Permalink
Added xHydro logos (#217)
Browse files Browse the repository at this point in the history
<!-- Please ensure the PR fulfills the following requirements! -->
<!-- If this is your first PR, make sure to add your details to the
AUTHORS.rst! -->
### Pull Request Checklist:
- [ ] This PR addresses an already opened issue (for bug fixes /
features)
  - This PR fixes #xyz
- [x] (If applicable) Documentation has been added / updated (for bug
fixes / features).
- [ ] (If applicable) Tests have been added.
- [x] CHANGELOG.rst has been updated (with summary of main changes).
- [x] Link to issue (:issue:`number`) and pull request (:pull:`number`)
has been added.

### What kind of change does this PR introduce?

* Added a new logo for the xHydro repo and documentation.
* Added some CSS modifications so that the logos render well in both
light and dark themes (courtesy of @SarahG-579462)

### Does this PR introduce a breaking change?

No.

### Other information: 

This logo was designed by Élyse Fournier (HQ) and Louise Arnal
(Ouranos), with inputs from the xHydro team.
  • Loading branch information
lou-a authored Oct 31, 2024
2 parents bc169c8 + eb83a6e commit 211acd2
Show file tree
Hide file tree
Showing 9 changed files with 110 additions and 11 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Changelog

v0.5.0 (unreleased)
-------------------
Contributors to this version: Gabriel Rondeau-Genesse (:user:`RondeauG`), Trevor James Smith (:user:`Zeitsperre`).
Contributors to this version: Gabriel Rondeau-Genesse (:user:`RondeauG`), Trevor James Smith (:user:`Zeitsperre`), Louise Arnal (:user:`lou-a`).

New features and enhancements
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -22,6 +22,7 @@ Internal changes
* Tests can now be run using the `pytest-xdist` plugin for distributed testing. See the `pytest-xdist documentation <https://pytest-xdist.readthedocs.io/en/stable/>`_ for more information. (:pull:`212`).
* Several tests reliant on online servers and services have been marked as `online` to prevent them from running in contexts where internet access is limited. (:pull:`212`).
* Many function docstrings and type hints have been updated for accuracy and precision. (:pull:`212`).
* The `xHydro` project now has a set of logos for use in documentation, the readme, and other materials. (:pull:`217`).

v0.4.0 (2024-10-04)
-------------------
Expand Down
24 changes: 20 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
======
xHydro
======
======================================
xHydro |logo| |logo-light| |logo-dark|
======================================

+----------------------------+-----------------------------------------------------+
| Versions | |pypi| |versions| |
Expand All @@ -22,7 +22,7 @@ Hydrological analysis library built with xarray
Features
--------

* Easily find and extract geospacial data from the Planetary Computer API and watershed boundaries from the HydroSHEDS API over any area of interest.
* Easily find and extract geospatial data from the Planetary Computer API and watershed boundaries from the HydroSHEDS API over any area of interest.
* Calibrate and execute Hydrotel and Raven-emulated hydrological models.
* Perform optimal interpolation on hydrological data (daily streamflow and indices).
* Compute hydrological indicators (e.g. n-day peak flow, annual maximum series, low flow, average flow, etc.) over custom date ranges.
Expand All @@ -34,6 +34,8 @@ Credits

This package was created with Cookiecutter_ and the `Ouranosinc/cookiecutter-pypackage`_ project template.

This logo was designed by Élyse Fournier (@elysefounier) and Louise Arnal (@lou-a), with inputs from the `xHydro` team.

.. _Cookiecutter: https://github.com/cookiecutter/cookiecutter
.. _`Ouranosinc/cookiecutter-pypackage`: https://github.com/Ouranosinc/cookiecutter-pypackage

Expand Down Expand Up @@ -62,6 +64,20 @@ This package was created with Cookiecutter_ and the `Ouranosinc/cookiecutter-pyp
:target: https://github.com/hydrologie/xhydro/blob/main/LICENSE
:alt: License

.. |logo| image:: https://raw.githubusercontent.com/hydrologie/xhydro/main/docs/logos/xhydro-logo-small-light.png
:target: https://github.com/hydrologie/xhydro
:alt: xHydro

.. |logo-light| image:: https://raw.githubusercontent.com/hydrologie/xhydro/main/docs/logos/empty.png
:target: https://github.com/hydrologie/xhydro
:alt:
:class: xhydro-logo-small only-light-inline

.. |logo-dark| image:: https://raw.githubusercontent.com/hydrologie/xhydro/main/docs/logos/empty.png
:target: https://github.com/hydrologie/xhydro
:alt:
:class: xhydro-logo-small only-dark-inline

.. |ossf| image:: https://api.securityscorecards.dev/projects/github.com/hydrologie/xhydro/badge
:target: https://securityscorecards.dev/viewer/?uri=github.com/hydrologie/xhydro
:alt: OpenSSF Scorecard
Expand Down
66 changes: 66 additions & 0 deletions docs/_static/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
@import url("styles/furo.css");

/* extend furo for inline ".only-dark" elements */
body .only-dark-inline,
body .only-light-inline {
display: none !important;
}

@media not print {
body[data-theme="dark"] .only-dark-inline,
body[data-theme="light"] .only-light-inline {
display: inline !important;
}
@media (prefers-color-scheme: dark) {
body:not([data-theme="light"]) .only-dark-inline{
display: inline !important;
}
}
@media (prefers-color-scheme: light) {
body:not([data-theme="dark"]) .only-light-inline{
display: inline !important;
}
}
}

@media print {
.only-light-inline{
display: inline !important;
}
.only-dark-inline{
display: none !important;
}
}

img.xhydro-logo-small.only-dark-inline {
width: 125px;
height: 125px;
margin: 0;
padding: 0;
background-color: transparent;
background-repeat: no-repeat;
border: none;
border-image-width: 0;
background-image: url("xhydro-logo-small-transparent.png");
}

img.xhydro-logo-small.only-light-inline {
width: 125px;
height: 125px;
margin: 0;
padding: 0;
background-color: transparent;
background-repeat: no-repeat;
border: none;
border-image-width: 0;
background-image: url("xhydro-logo-small-light.png");
}

img.xhydro-logo-small.no-theme {
display: none;
width: 0;
}

button.copybtn.copybtn svg {
stroke: var(--color-copybutton);
}
28 changes: 22 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,19 +143,31 @@
#
html_theme = "furo"

# Theme options are theme-specific and customize the look and feel of a
# theme further. For a list of options available for each theme, see the
# documentation.
# Theme options are theme-specific and customize the look and feel of a theme further.
# For a list of options available for each theme, see the documentation.
#
# html_theme_options = {}
html_theme_options = {
"light_logo": "xhydro-logo-light.png",
"dark_logo": "xhydro-logo-transparent.png",
}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
if not os.path.exists("_static"):
os.makedirs("_static")
html_static_path = ["_static"]

html_static_path = ["_static", "logos"]

html_sidebars = {
"**": [
"sidebar/scroll-start.html",
"sidebar/brand.html",
"sidebar/search.html",
"sidebar/navigation.html",
"sidebar/ethical-ads.html",
"sidebar/scroll-end.html",
]
}

# -- Options for HTMLHelp output ---------------------------------------

Expand Down Expand Up @@ -217,3 +229,7 @@
"hydrology",
),
]


def setup(app):
app.add_css_file("style.css")
Binary file added docs/logos/empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/logos/xhydro-logo-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/logos/xhydro-logo-small-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/logos/xhydro-logo-small-transparent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/logos/xhydro-logo-transparent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 211acd2

Please sign in to comment.