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

Make coastsat into a package #55

Open
borgstad opened this issue Dec 6, 2019 · 16 comments
Open

Make coastsat into a package #55

borgstad opened this issue Dec 6, 2019 · 16 comments
Labels
enhancement New feature or request

Comments

@borgstad
Copy link
Contributor

borgstad commented Dec 6, 2019

In order to use coastsat, you have to set your pythonpath/start your environment with coastsat as root dir.

It would be really nice if CoastSat existed as an installable package.

If you are interested, I could create a PR

@kvos
Copy link
Owner

kvos commented Dec 6, 2019

that would be great @borgstad and highly appreciated by new users!

I rememeber having some issues when installing the packages with pip, especially the gdal package (which still causes issues #54 ). Are you thinking about something like pip install coastsat?

@borgstad
Copy link
Contributor Author

borgstad commented Dec 6, 2019

Yes exactly, pip install coastsat.

About the gdal issue: I will look into that and report back my findings. I have previously had problems with gdal and conda/pip.

@borgstad
Copy link
Contributor Author

GDAL cannot be installed via pip on either Windows or Linux, as it needs a precompiled binary.
As things are right now, coastsat can only be installed after the user has setup a conda environment containing gdal and co.

I have nonetheless created a pull request, adding a little bit to the Readme, and a setup.py file.. Atleast it takes the burden away of messing with PYTHONPATH and the location of the coastsat library

@borgstad borgstad mentioned this issue Dec 12, 2019
@cosstas
Copy link

cosstas commented Dec 16, 2019

I too believe that coastsat should (additionally) be available via pip. Pre-requisite GDAL binaries can be installed separately from wheels (GDAL) created and maintained by Christoph Gohlke.
For example, rasterio is using a similar installation approach using Binary Distributions.

@kvos
Copy link
Owner

kvos commented Dec 17, 2019

thanks @borgstad for looking this up and making a PR #60, much appreciated. The only minor change is that I wouldn't call the package CoastSatDHI (or with the name of any organisation, includng mine) as we don't want to do any branding here but just open-source community development.

Since there are still issues with the GDAL package, it's worth having a discussion on what are the possible options to make the installation of coastsat as simple as possible. About half of the issues opened by users are on the installation!

From @cosstas suggestion above we could also run a command to download the GDAL wheels separately and then install with pip.
What about making a package on conda-forge, is that an option as well?

One thing to keep in mind is that structure of coastsat is still evolving and we want to keep it flexible so that users can just pull the changes from github without having to re-install the package each time.

Keen to have current users opinion on this

@borgstad
Copy link
Contributor Author

thanks @borgstad for looking this up and making a PR #60, much appreciated. The only minor change is that I wouldn't call the package CoastSatDHI (or with the name of any organisation, includng mine) as we don't want to do any branding here but just open-source community development.

This is definitely an error on my part, I pushed a wrong version, sorry about the confusion, I will updated it as soon as I have time.

Since there are still issues with the GDAL package, it's worth having a discussion on what are the possible options to make the installation of coastsat as simple as possible. About half of the issues opened by users are on the installation!

From @cosstas suggestion above we could also run a command to download the GDAL wheels separately and then install with pip.

Nice suggestion!

@cosstas
Copy link

cosstas commented Dec 17, 2019

From @cosstas suggestion above we could also run a command to download the GDAL wheels separately and then install with pip.

I am in favor of recommending to the user of the most favorable way to install GDAL manually on each platform. In my experience, this is the common practice for pypi packages that require GDAL. At least to begin with.

One thing to keep in mind is that structure of coastsat is still evolving and we want to keep it flexible so that users can just pull the changes from github without having to re-install the package each time.

If coastsat is following a release schedule in pypi, (at least for major updates) a simple
pip install --upgrade coastsat
would do. Advanced users can always clone from git for current development.

@kvos kvos added the enhancement New feature or request label Dec 21, 2019
@vighneshrajendrans
Copy link

@kvos coastSat is applicable for island?;downloading images is possible but further steps end with an error

@cosstas
Copy link

cosstas commented Oct 23, 2020

Today I found some time to install CoastSat and have a go at it. I copied the sources in my site-packages folder. Earth engine and google api were installed using pypi. The rest were already already installed manually as described before. And that was all, I was able to run the example.
It has been almost a year and there was no update regarding the pypi package. Why is it so important to make CoastSat 100% install-able with pypi? Why can't we let pip install all the pre-requisites by itself and let the user manually install GDAL?

@kvos
Copy link
Owner

kvos commented Nov 2, 2020

there have been so many issues open because of the installation process that any update that could make the installation easier is more than welcome. What is required to make a pypi package?

@cosstas
Copy link

cosstas commented Nov 2, 2020

Haven't published a package myself, but since @borgstad committed #60, I think the maintainer (you:-)) must create an account with PyPI, create a package and upload it. The instructions in this link (https://packaging.python.org/tutorials/packaging-projects/) are straightforward and don't look that demanding. I suppose maintaining both a conda repository and a PyPI package adds some effort to publishing a version.

@cosstas
Copy link

cosstas commented Jan 12, 2021

I am working towards creating a PyPi package. First of all setup.py needs be defined so that pip install can work. @kvos (or anyone else interested) Can you try installing CoastSat from my branch using the following command:
pip install https://github.com/cosstas/CoastSat/archive/v1.1.1-alpha.8.tar.gz
This release is just the current master with setup.py added. Requirements are something to be tweaked by @kvos should the rest of installation procedure works out. GDAL still needs to be already installed.
Any comments or suggestions are welcome.

@kvos
Copy link
Owner

kvos commented Jan 13, 2021

sounds great! will test it out. What happens with the GDAL library though for new users?

@cosstas
Copy link

cosstas commented Jan 13, 2021

I haven't come across an automated solution yet. I guess the user should be directed to take the following steps:

  1. Download an appropriate wheel from Christoph Gohlke's repository: (https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal)
  2. Change directory to where the wheel is downloaded.
  3. pip install <wheel_filename> e.g. pip install GDAL‑3.2.1‑cp37‑cp37m‑win_amd64.whl for Python 3.7 x64 system.

As mentioned before, rasterio is taking a similar approach: (https://github.com/mapbox/rasterio#dependencies). This is meant to be an alternative anyway. The user can always be recommended to take the easiest path through anaconda.

@ocefpaf
Copy link

ocefpaf commented Feb 9, 2022

sounds great! will test it out. What happens with the GDAL library though for new users?

It would be nice to re-write the gdal calls with rasterio instead of gdal calls. It would make it more modern, easier to maintain, and there are rasterio wheels available.

@2320sharon
Copy link
Contributor

Hey all, have there been any updates in the creation of a coastsat package? I'm interested in helping out in any way I can. I see the installation of GDAL seems to be the biggest obstacle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants