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

NameError: name 'ipyleaflet' is not defined #277

Open
glukvit opened this issue Jan 22, 2024 · 1 comment
Open

NameError: name 'ipyleaflet' is not defined #277

glukvit opened this issue Jan 22, 2024 · 1 comment
Labels

Comments

@glukvit
Copy link

glukvit commented Jan 22, 2024

I am trying to get using Plot Tide Forecast.ipynb to get a time series of the earth and ocean tide at a certain point, but in string:

m = pyTMD.tools.leaflet(center=(LAT,LON), zoom=3,
    zoom_control=True, marker_control=True)

I ran into the following problem:

NameError                                 Traceback (most recent call last)
Cell In[3], [line 3](vscode-notebook-cell:?execution_count=3&line=3)
      [1](vscode-notebook-cell:?execution_count=3&line=1) # default coordinates to use
      [2](vscode-notebook-cell:?execution_count=3&line=2) LAT,LON = (-76.0, -40.0)
----> [3](vscode-notebook-cell:?execution_count=3&line=3) m = pyTMD.tools.leaflet(center=(LAT,LON), zoom=3,
      [4](vscode-notebook-cell:?execution_count=3&line=4)     zoom_control=True, marker_control=True)
      [5](vscode-notebook-cell:?execution_count=3&line=5) # show map
      [6](vscode-notebook-cell:?execution_count=3&line=6) m.map

File [~/bin/jupiter/.venv/lib/python3.10/site-packages/pyTMD-2.1.1.dev3](https://untitled+.vscode-resource.vscode-cdn.net/~/bin/jupiter/.venv/lib/python3.10/site-packages/pyTMD-2.1.1.dev3)+gef78f74-py3.10.egg/pyTMD/tools.py:217, in leaflet.__init__(self, projection, **kwargs)
    [215](https://untitled+.vscode-resource.vscode-cdn.net/~/bin/jupiter/.venv/lib/python3.10/site-packages/pyTMD-2.1.1.dev3+gef78f74-py3.10.egg/pyTMD/tools.py:215) # create basemap in projection
    [216](https://untitled+.vscode-resource.vscode-cdn.net/~/bin/jupiter/.venv/lib/python3.10/site-packages/pyTMD-2.1.1.dev3+gef78f74-py3.10.egg/pyTMD/tools.py:216) if (projection == 'Global'):
--> [217](https://untitled+.vscode-resource.vscode-cdn.net/~/bin/jupiter/.venv/lib/python3.10/site-packages/pyTMD-2.1.1.dev3+gef78f74-py3.10.egg/pyTMD/tools.py:217)     self.map = ipyleaflet.Map(center=kwargs['center'],
    [218](https://untitled+.vscode-resource.vscode-cdn.net/~/bin/jupiter/.venv/lib/python3.10/site-packages/pyTMD-2.1.1.dev3+gef78f74-py3.10.egg/pyTMD/tools.py:218)         zoom=kwargs['zoom'], max_zoom=15, world_copy_jump=True,
    [219](https://untitled+.vscode-resource.vscode-cdn.net/~/bin/jupiter/.venv/lib/python3.10/site-packages/pyTMD-2.1.1.dev3+gef78f74-py3.10.egg/pyTMD/tools.py:219)         attribution_control=kwargs['attribution'],
    [220](https://untitled+.vscode-resource.vscode-cdn.net/~/bin/jupiter/.venv/lib/python3.10/site-packages/pyTMD-2.1.1.dev3+gef78f74-py3.10.egg/pyTMD/tools.py:220)         basemap=ipyleaflet.basemaps.Esri.WorldTopoMap)
    [221](https://untitled+.vscode-resource.vscode-cdn.net/~/bin/jupiter/.venv/lib/python3.10/site-packages/pyTMD-2.1.1.dev3+gef78f74-py3.10.egg/pyTMD/tools.py:221)     self.crs = 'EPSG:3857'
    [222](https://untitled+.vscode-resource.vscode-cdn.net/~/bin/jupiter/.venv/lib/python3.10/site-packages/pyTMD-2.1.1.dev3+gef78f74-py3.10.egg/pyTMD/tools.py:222) elif (projection == 'North'):

NameError: name 'ipyleaflet' is not defined

What could be the problem? There were no problems when installing pyTMD. I am grateful in advance for any help!

@tsutterley
Copy link
Owner

Hi @glukvit!
As part of #156 and other issues, I removed dependencies that were part of the example notebooks but not needed as part of the "core code". These are now listed in the documentation as "Optional Dependencies". I think if you still build using environment.yml you can get the full build. Sorry for the trouble!!

@tsutterley tsutterley added the bug label Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants