Coder Social home page Coder Social logo

genericmappingtools / try-gmt Goto Github PK

View Code? Open in Web Editor NEW
38.0 12.0 10.0 57 KB

Try GMT, PyGMT, and GMT.jl online! All in one place!

Home Page: https://mybinder.org/v2/gh/GenericMappingTools/try-gmt/master?urlpath=lab/tree/landing-page.ipynb

License: BSD 3-Clause "New" or "Revised" License

Jupyter Notebook 100.00%
gmt pygmt jupyter-notebook julia python earth-science geoscience binder

try-gmt's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

try-gmt's Issues

Don't change links that the user is about to click

  1. Visit https://github.com/GenericMappingTools/try-gmt
  2. In the upper right corner, click the link https://mybinder.org/v2/gh/GenericMappingTools/try-gmt/master?urlpath=lab/tree/landing-page.ipynb
  3. We see "Starting repository: GenericMappingTools/try-gmt/master ", and underneath it a link "New to Binder? Check out the Binder Documentation for more information". But before we can read and comprehend and click the link, it has changed into something else! So frustrating!

Improve the speed for loading the GMT.jl package

Loading the GMT.jl package (using GMT) is very slow (~10 s) for the first time, because Julia needs to precompile the GMT.jl package. It would be better to precompile the package when building the docker image, so that the package is already precompiled when users run using GMT.

As I understand it, running julia -e "using GMT" may do the precompiling.

@joa-quim Is it correct? Is there a way to precompile all Julia packages?

The Julia example doesn't work

The following example in the Julia demo notebook doesn't work:

basemap(region=:g, proj=(name=:Otho, center=(220,30)), figsize=8, frame=:g)
grdimage!("@earth_relief_20m", cmap=:geo, shade=true)
coast!(res=:crude, shore=true, area=1000)
plot!("@hotspots.txt", marker=:circle, size="0.2c", markerfacecolor=:red, show=true)

The error messages are:

┌ Warning: Very likely the projection name (Otho) is unknown to me. Expect troubles
└ @ GMT /srv/julia/pkg/packages/GMT/fZQQL/src/common_options.jl:436
psbasemap [WARNING]:  not a valid number and may not be decoded properly.
psbasemap [ERROR]: Your scale or width () resulted in a zero value.
psbasemap [ERROR]: Option -J parsing failure. Correct syntax:
	-Jo[a]<lon0>/<lat0>/<azimuth>/<scale> OR -JO[a]<lon0>/<lat0>/<azimuth>/<width>
	-Jo[b]<lon0>/<lat0>/<b_lon>/<b_lat>/<scale> OR -JO[b]<lon0>/<lat0>/<b_lon>/<b_lat>/<width>
	-Joc<lon0>/<lat0>/<lonp>/<latp>/<scale> OR -JOc<lon0>/<lat0>/<lonp>/<latp>/<width>
	  <scale> is <1:xxxx> or cm/oblique degree, or use <width> in cm
psbasemap [ERROR]: Offending option -JOt220/30/8
Something went wrong when calling the module. GMT error number = 71

Stacktrace:
 [1] error(::String, ::Int32) at ./error.jl:42
 [2] gmt(::String, ::Nothing) at /srv/julia/pkg/packages/GMT/fZQQL/src/gmt_main.jl:246
 [3] finish_PS_module(::Dict{Symbol,Any}, ::String, ::String, ::Bool, ::Bool, ::Bool, ::Nothing) at /srv/julia/pkg/packages/GMT/fZQQL/src/common_options.jl:2701
 [4] #basemap#213(::Bool, ::Base.Iterators.Pairs{Symbol,Any,NTuple{4,Symbol},NamedTuple{(:region, :proj, :figsize, :frame),Tuple{Symbol,NamedTuple{(:name, :center),Tuple{Symbol,Tuple{Int64,Int64}}},Int64,Symbol}}}, ::typeof(basemap), ::String, ::Nothing) at /srv/julia/pkg/packages/GMT/fZQQL/src/psbasemap.jl:64
 [5] (::GMT.var"#kw##basemap")(::NamedTuple{(:region, :proj, :figsize, :frame),Tuple{Symbol,NamedTuple{(:name, :center),Tuple{Symbol,Tuple{Int64,Int64}}},Int64,Symbol}}, ::typeof(basemap)) at ./none:0
 [6] top-level scope at In[7]:1

@joa-quim Anything wrong?

Need feedbacks on the Jupyter lab for trying GMT and its wrappers online

This repository sets up a single Jupyter lab environment, with the latest/stable GMT, PyGMT, and GMT.jl installed. The idea and some contents of this repository are from our older projects, gmt6demo, try-gmt-python, and foss4g2019oceania.

Anyone can run GMT commands (i.e., in bash), PyGMT, and GMT.jl in this online Jupyter lab, with no need to install anything locally.

I believe this Jupyter lab would be useful for both new and old GMT users who want to try GMT and its wrappers before spending some time setting up a local environment. It also provides a uniform environment for future GMT workshops and short courses, so that we don't have to spend hours solving the GMT installation problems (I'm not sure about its performance if dozens of peoples use it simultaneously).

The Jupyter lab is freely hosted by Pangeo Binder. You can try it by clicking the badge below:

Pangeo Binder

it usually takes <30 s to launch the Jupyter lab, the you can try the three demos for bash, Python, and Julia, respectively.

Future Plans

Here are some of my thoughts to improve it:

  • Cache the low-resolution (>06m) earth relief data so that users don't have to wait for downloading them [Done in #4]
  • Install a few extra Python packages (e.g., scipy, matplotlib) and Julia packages to make it more suitable for practical plots
  • Create a dev branch and set up another Jupyter lab environment with the master/unstable/developing GMT, PyGMT, and GMT.jl installed.
  • Host it on Google's colab servers (also free), which seem faster.
  • Post it on the GMT forum to increase its visibility (https://forum.generic-mapping-tools.org/t/try-gmt-pygmt-gmt-jl-online-at-pangeo-binder/561)
  • Add a "Try it online!" menu on the GMT homepage to increase its visibility (GenericMappingTools/website#71)
  • Add "Try it online!" badges to the README file of GMT, PyGMT and GMT.jl repositories?

Any thoughts and suggestions? @GenericMappingTools/core @GenericMappingTools/gmt-contributors @GenericMappingTools/python @GenericMappingTools/python-contributors

Julia version is still 1.3.1

In Project.toml, we specify the Julia version using julia = "1.5", but the actual installed Julia version is still 1.3.

I must misunderstand how Project.toml works for Julia.

This post said the following syntax will work:

julia = "=1.0.4"

but PR #11 uses this syntax and still has Julia 1.3.

Install optional geopandas dependency on try-gmt?

Should we install geopandas (an optional dependency of PyGMT) on try-gmt? Just asking because a new contributor trying to work on GenericMappingTools/pygmt#1374 is having trouble with setting up PyGMT and Geopandas locally, and it would be nice to have a virtual cloud environment with both these dependencies installed already.

Disadvantage is that the build and start-time for the Binder environment will take longer, because geopandas brings in some heavy dependencies like GEOS and PROJ (see https://geopandas.org/getting_started/install.html#dependencies).

Thoughts? Upvote 👍 to go for it, downvote 👎 for sticking to the status quo.

Google Colab Implementation

Hi,

Hope this message finds you well. I developed a teaching module using PyGMT back in February using Google Colab. I used this described solution to import PyGMT and things worked well. It sometimes took running the import cell another time -- some folks got an error upon first run -- but things worked successfully

I am currently preparing to teach this module again and just tried running through the code again. I am now getting the error appended. Do you know what may be causing this error? I didn't find any solutions on the forum and figured I may raise the issue here. Thanks in advance for any guidance.

Best,
Sarah

---------------------------------------------------------------------------
GMTCLibNotFoundError                      Traceback (most recent call last)
[<ipython-input-2-9b6890099622>](https://localhost:8080/#) in <cell line: 8>()
      6 condacolab.install()
      7 get_ipython().system('mamba install pygmt')
----> 8 import pygmt
      9 from matplotlib import pyplot as plt
     10 get_ipython().run_line_magic('matplotlib', 'inline')

4 frames
[/usr/local/lib/python3.10/site-packages/pygmt/clib/loading.py](https://localhost:8080/#) in load_libgmt(lib_fullnames)
     57 
     58     if error:
---> 59         raise GMTCLibNotFoundError("\n".join(error_msg))
     60 
     61     return libgmt

GMTCLibNotFoundError: Error loading GMT shared library at '/usr/local/lib/libgmt.so'.
/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /usr/local/lib/./libgdal.so.32)
Error loading GMT shared library at 'libgmt.so'.
libgmt.so: cannot open shared object file: No such file or directory

GMT.jl is broken on Binder

image

I've seen this error when building GMT on Ubuntu latest for CI. I'm guessing the usual dependencies shit between glib and GDAL. My solution wast to use a Ubuntu 2018

Binder repository for interactive GMT tutorials

Description of the desired feature

A large part of the NASA proposal that we’re working on involves improving the GMT documentation, including tutorials. One goal is to make the tutorials reliably repeatable and fully reproducible. Remote files will be useful for this purpose, which are already used in the existing tutorial but not some other parts of the documentation. In addition, it would be great for people to be able to learn GMT, PyGMT, GMT.jl, and/or gmtmex without needing to go through the installation steps. My expectation is that Binder and JupyterLab environments would be an excellent way to ensure that the tutorials are reliably repeatable. The result would be similar to try-gmt. The binder-ready repos would complement static versions of the tutorials in the docs that users could follow in their local environments. Pinging @GenericMappingTools/core, @GenericMappingTools/gmt-contributors, @GenericMappingTools/python, and @GenericMappingTools/python-maintainers for opinions about whether this is worthwhile.

I am also to happy to chat in more detail about other documentation improvements included in the proposal, so please feel free to reach out. Slack is probably the easiest medium for a broader conversation about the proposal.

Are you willing to help implement and maintain this feature? Yes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.