Open yvonnefroehlich opened 1 year ago
Here are some quick ideas about my expected functionality for the dcw data.
>>> from pygmt import dcw
>>> dcw.path
/path/to/gmt/share/dcw # path to the dcw directory
>>> dcw.version
2.1.2
>>> north_america = dcw(continent="NA") # A DCW_Continent object
>>> print(north_america) # print something about the North America continent
north_america.code = "=NA" # GMT's internal code
north_america.countries = ["AO", "BF", ...] # list of country codes
# Or maybe it should be dict of DCW_Country object, then we can have the following syntax:
>>> north_america["US"] # A DCW_Country object
>>> north_america.to_file("na.txt") # save data to a file
>>> gdf = north_america.to_geopandas() # save data into a geopandas object
>>> north_america.region # region: [xmin, xmax, ymin, ymax]
# Here is another way to have a DCW_Country object
>>> usa = dcw(country="US") # returns a DCW_Country object
>>> usa.code
"US"
>>> usa.to_file("usa.txt")
>>> gdf = usa.to_geopandas()
>>> usa.region
[xxx, xxx, xxx, xxx]
>>> usa.states # List of DCW_State object
["CI", "MI", ...]
>>> usa["CI"] # A DCW_State object
# Here is another way to have a DCW_State object
>>> california = dcw(country="US", state="CI")
>>> california.code
"US.CI"
>>> california.to_file("ci.txt")
>>> california.to_geopandas()
>>> california.region
[xxx, xxxx, xxx, xxx]
Description of the problem
First mentioned in https://github.com/GenericMappingTools/pygmt/pull/2428#issuecomment-1536777780.
In the docstring for the
dcw
parameter ofpygmt.Figure.coast
we say:I tried this, but so far I am not sure how it should work. I only get an output when running the python script or code directly in a terminal. When using an IDE (e.g., Spyder, JupyterLab) there is no output neither in the console nor in the terminal. Further, this part of the docstring is not precise, as +l gives the codes for the countries, but +L gives the codes for the states/territories.
Minimal Complete Verifiable Example
Full error message
System information