[go: up one dir, main page]

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

Merge for v8.3 #246

Merged
merged 69 commits into from
Sep 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
fe93d44
fix issues with "inherit_position=False" for colorbars
raphaelquast Jun 4, 2024
de375f6
make sure cached layers are re-drawn if a colorbar changes the axes-size
raphaelquast Jun 4, 2024
cc1b23f
fix "pick search radius" not recognized if 1D brute-force queries are…
raphaelquast Jun 13, 2024
db451fb
add "delay_draw" contextmanager to delay drawing and updates
raphaelquast Jun 13, 2024
c23b424
add .DS_Store in gitignore for mac
Fanchengyan Jul 21, 2024
240295b
GitButler Integration Commit
gitbutler-client Jul 21, 2024
fbd0b40
reconstruct doc @ sphinx_rtd_theme->pydata_sphinx_theme
Fanchengyan Jul 21, 2024
eb3d586
refine docs
Fanchengyan Jul 21, 2024
511a570
using logo in doc header
Fanchengyan Jul 21, 2024
40ae3e5
Merge branch 'master' into dev
Fanchengyan Jul 21, 2024
67e1aea
Merge branch 'gitbutler/integration' into dev
Fanchengyan Jul 21, 2024
cc9f408
formated by hook
Fanchengyan Jul 24, 2024
9c617d5
refine docs: add logo in header; emoji title; wider body;
Fanchengyan Jul 24, 2024
058c8de
format by hooks & fix sevel dir bugs
Fanchengyan Jul 24, 2024
1de9e45
fix bugs for pydata-sphinx-theme
Fanchengyan Jul 24, 2024
398787d
add navbar-logo.html to _templates for readthedocs
Fanchengyan Jul 24, 2024
c8cc4e2
update sphinx to 7.4.7 for pydata-theme
Fanchengyan Jul 24, 2024
2ca8dc3
rm generated docs
Fanchengyan Jul 24, 2024
9a03bbd
Fix pytest bug related to document structure modification
Fanchengyan Jul 24, 2024
83edf76
remove unneeded files
Fanchengyan Jul 25, 2024
a849288
remove background color for the shapes-grid & remove logo in home page
Fanchengyan Jul 25, 2024
d7cfd7e
Refactor example section & myst-nb -> nbsphinx for gallery example
Fanchengyan Jul 25, 2024
47d6514
update baseline to pass test
Fanchengyan Jul 26, 2024
a389227
skip test_set_extent_to_location due to nominatim.openstreetmap.org i…
Fanchengyan Jul 26, 2024
ac24fab
add gen_gallery.py for auto gallery | remove nbsphinx
Fanchengyan Aug 5, 2024
47dba5a
fix make html not work in windows | refine doc_env
Fanchengyan Aug 5, 2024
4d92db2
skip running example_webmaps.ipynb
Fanchengyan Aug 5, 2024
325c4cd
change example path in pytest
Fanchengyan Aug 6, 2024
4368159
fix pre-commit
Fanchengyan Aug 7, 2024
478ca81
update gh action versions
raphaelquast Aug 9, 2024
43cc572
Merge branch 'dev' into gitbutler/integration
Fanchengyan Aug 10, 2024
9da85f9
update docs: using myst_sphinx_gallery to gen gallery
Fanchengyan Aug 10, 2024
e57954b
update environment.yml
Fanchengyan Aug 16, 2024
ba6dbe1
change myst-sphinx-gallery to conda channel
Fanchengyan Aug 20, 2024
b899eec
custom gallery style: font (black small lighter) & add 10px margin fo…
Fanchengyan Aug 20, 2024
18dfa2f
Merge branch 'gitbutler/integration' of https://github.com/Fanchengya…
Fanchengyan Aug 20, 2024
4565e5b
improve dark mode effect @ remove emojis in header
Fanchengyan Aug 23, 2024
768922c
remove unnecessary dependencies
Fanchengyan Aug 23, 2024
c58a125
back to origin baseline
Fanchengyan Aug 23, 2024
ac35927
Merge branch 'dev' of https://github.com/raphaelquast/EOmaps into git…
Fanchengyan Aug 23, 2024
1c72162
fix sphinx warning "Summarised items should not include the current m…
raphaelquast Aug 24, 2024
616779b
update doc dependencies to most recent versions
raphaelquast Aug 24, 2024
c06165c
fix identification of documentation and example-codeblocks as unittests
raphaelquast Aug 24, 2024
10b9949
address docutils PendingDeprecationWarning
raphaelquast Aug 24, 2024
3b0c672
Shorten section titles to better fit into right sidebar
raphaelquast Aug 24, 2024
843615f
fix autdoc for reader methods
raphaelquast Aug 25, 2024
6aa9f69
hide left sidebars for orphan-pages
raphaelquast Aug 25, 2024
2f14b1f
remove secondary sidebar for galery page
raphaelquast Aug 25, 2024
ddab920
remove primary sidebar on API-reference landing page and add proper h…
raphaelquast Aug 25, 2024
65955c1
re-structure user-gruide landing-page to avoid intermediate pages
raphaelquast Aug 25, 2024
61849fe
use object-name for autodoc to ensure uniform naming in TOC
raphaelquast Aug 25, 2024
f732bf9
add missing user guide sections
raphaelquast Aug 26, 2024
f9d9e82
Merge pull request #249 from Fanchengyan/gitbutler/integration
raphaelquast Aug 26, 2024
e17df4e
add new method ScaleBar.set_rotation()
raphaelquast Aug 28, 2024
4efaa9b
add option to use arbitrary geometries as map boundary
raphaelquast Jun 23, 2024
8e3cb54
allow passing Polygons or LineStrings as map-boundary
raphaelquast Aug 28, 2024
680a0de
add version-switcher to docs
raphaelquast Aug 30, 2024
4e6ba03
update doc versions
raphaelquast Aug 30, 2024
3f81fe1
update docs version switcher
raphaelquast Aug 30, 2024
406d14e
make pre-commit happy
raphaelquast Aug 30, 2024
c9d0982
minor
raphaelquast Aug 30, 2024
52c8a65
Merge pull request #237 from raphaelquast/geometry_frames
raphaelquast Aug 30, 2024
3aaa5f2
update version to v8.3
raphaelquast Aug 30, 2024
171e11b
update readme links
raphaelquast Aug 31, 2024
fd9e47e
add conda-forge image-link and use custom icons for pypi and conda-forge
raphaelquast Aug 31, 2024
dacc516
update readme
raphaelquast Aug 31, 2024
6776337
add docstring for Maps.delay_draw
raphaelquast Aug 31, 2024
20ed1f8
add delay_draw to docs
raphaelquast Aug 31, 2024
eaf323b
update readme
raphaelquast Aug 31, 2024
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
Prev Previous commit
Next Next commit
add new method ScaleBar.set_rotation()
  • Loading branch information
raphaelquast committed Aug 28, 2024
commit e17df4e01ddc287ba33cd174d34e64a51f0f5880
23 changes: 23 additions & 0 deletions eomaps/scalebar.py
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,29 @@ def set_position(self, pos=None, auto_pos=None, azim=None):

self._update(BM_update=True)

def set_rotation(self, ang=0):
"""
Set the absolute rotation angle of the first segment of the scalebar.

Note
----
This method sets the "absolute rotation angle" in display units,
not the "azimuth angle" which can be set with :py:meth:`ScaleBar.set_position`.

Parameters
----------
ang : float
The rotation angle.

"""
lon, lat, _ = self.get_position()
x0, y0 = self._m._transf_lonlat_to_plot.transform(lon, lat)
x1, y1 = self._m._transf_lonlat_to_plot.transform(
*self._geod.fwd(lon, lat, -ang, self.get_scale())[:2]
)
azim = np.rad2deg(-np.arctan2(x1 - x0, y1 - y0))
self.set_position((lon, lat), azim=azim)

def _set_position(self, lon=None, lat=None, azim=None, update=False):
if lon is None:
lon = self._lon
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions tests/test_scalebar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import pytest
from eomaps import Maps


@pytest.mark.mpl_image_compare()
def test_scalebar_display_rotation():

m = Maps(2154)
m.add_feature.preset.coastline()

scb1 = m.add_scalebar((-6, 43.45))
scb1.set_rotation(0)

scb2 = m.add_scalebar((2.5, 46))
scb2.set_rotation(45)

scb3 = m.add_scalebar((-7, 51))
scb3.set_rotation(90)

return m
Loading