question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

fig.coast() with just dcw kwarg fails

See original GitHub issue

Description of the problem

Using fig.coast(dcw=...) fails, asking for additional kwargs. I have to add another kwarg, like water='white', to get things to plot. I believe that dcw alone should be enough.

Full code that generated the error

import pygmt

fig = pygmt.Figure()
fig.coast(region='US', projection='S232.7435/90/8i', frame=['af', 'EWSn'], dcw='US+gred')
fig.show()

Expected output

out

Full error message

---------------------------------------------------------------------------
GMTInvalidInput                           Traceback (most recent call last)
<ipython-input-10-bd3570a700d7> in <module>
      2 
      3 fig = pygmt.Figure()
----> 4 fig.coast(region='US', projection='S232.7435/90/8i', frame=['af', 'EWSn'], dcw='US+gred')
      5 fig.show()

/opt/miniconda3/envs/roses/lib/python3.7/site-packages/pygmt/helpers/decorators.py in new_module(*args, **kwargs)
    279                 if alias in kwargs:
    280                     kwargs[arg] = kwargs.pop(alias)
--> 281             return module_func(*args, **kwargs)
    282 
    283         new_module.aliases = aliases

/opt/miniconda3/envs/roses/lib/python3.7/site-packages/pygmt/helpers/decorators.py in new_module(*args, **kwargs)
    423                         kwargs[arg] = separators[fmt].join(f"{item}" for item in value)
    424             # Execute the original function and return its output
--> 425             return module_func(*args, **kwargs)
    426 
    427         return new_module

/opt/miniconda3/envs/roses/lib/python3.7/site-packages/pygmt/src/coast.py in coast(self, **kwargs)
    191         raise GMTInvalidInput(
    192             """At least one of the following arguments must be specified:
--> 193             lakes, land, water, rivers, borders, Q, or shorelines"""
    194         )
    195     with Session() as lib:

GMTInvalidInput: At least one of the following arguments must be specified:
            lakes, land, water, rivers, borders, Q, or shorelines

System information

Please paste the output of python -c "import pygmt; pygmt.show_versions()":

PyGMT information:
  version: v0.0.0
System information:
  python: 3.7.9 | packaged by conda-forge | (default, Feb 13 2021, 19:53:10)  [Clang 11.0.1 ]
  executable: /opt/miniconda3/envs/roses/bin/python
  machine: Darwin-20.3.0-x86_64-i386-64bit
Dependency information:
  numpy: 1.16.2
  pandas: 1.1.5
  xarray: 0.15.0
  netCDF4: 1.5.3
  packaging: 20.9
  ghostscript: 9.53.3
  gmt: 6.1.1
GMT library information:
  binary dir: /opt/miniconda3/envs/roses/bin
  cores: 8
  grid layout: rows
  library path: /opt/miniconda3/envs/roses/lib/libgmt.dylib
  padding: 2
  plugin dir: /opt/miniconda3/envs/roses/lib/gmt/plugins
  share dir: /opt/miniconda3/envs/roses/share/gmt
  version: 6.1.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
willschlitzercommented, Feb 16, 2021

@seisman Just submitted the PR

1reaction
willschlitzercommented, Feb 15, 2021

Sounds good. Looks like we need to just do a quick update to the error raising.

Less than 12 hours since v0.3.0 released and we’re already coming up for changes in v0.3.1! 😂

Read more comments on GitHub >

github_iconTop Results From Across the Web

pygmt.Figure.coast
Plots grayshaded, colored, or textured land-masses [or water-masses] on maps and [optionally] draws coastlines, rivers, and political ...
Read more >
Mutual exclusivity of `imshow` and `inset` in current API - GMT.jl Q&A
Now, the actual plot I am trying to make has multiple layers: coast; grdimage + grdcontour + colorbar; imshow (using an GMTDataSet, so...
Read more >
Index · GMT - JuliaHub
Only accept ASCII data records that contains the specified pattern. ... Create a categorical CPT to use with the output of coast(dcw=.
Read more >
wordlist ranked - Massachusetts Institute of Technology
... use any there see c so only his e when contact here business who web also ... proposal birthday philadelphia sharing portal...
Read more >
Click here to download - Computer Science
... may what which their news out use any there see only so his when contact here ... traditional campus tom showing creative...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found