Giter Site home page Giter Site logo

brazil-data-cube / lccs.py Goto Github PK

View Code? Open in Web Editor NEW
5.0 6.0 4.0 201 KB

Python Client Library for Land Cover Classification System Web Service

License: GNU General Public License v3.0

Python 95.38% Shell 1.40% HTML 3.22%
geospatial gis earth-science land-cover land-use python

lccs.py's Issues

Release version 0.8.0

Tasks:

  • Inform the right version in: lccs/version.py
  • Run all the tests.
  • Create a branch named: b-0.8.
  • From the branch b-0.8, create a tag named: v-0.8.0.
  • In the master branch increase version in lccs/version.py to 1.0.0
  • Notify users that a new version is released.

Bug in client when no access token is provided

There is a bug in lccs.py when a request is made to LCCS Server without property access_token.

curl https://path/to/lccs/classification_systems?access_token=token_e
    return self.svc.lccs_ws.get_system_classification()
  File "/terra_collect/terra_collect/services/lccs_ws.py", line 51, in get_system_classification
    systems = lccs_service.classification_systems
  File "/usr/local/lib/python3.7/site-packages/lccs/lccs.py", line 90, in classification_systems
    return self._get_classification_systems()
  File "/usr/local/lib/python3.7/site-packages/lccs/lccs.py", line 61, in _get_classification_systems
    data = Utils._get(url)
  File "/usr/local/lib/python3.7/site-packages/lccs/utils.py", line 40, in _get
    response.raise_for_status()
  File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: NOT FOUND for url: http://dev-lccs-ws:5000/classification_systems&language=pt-br

The error occurs due wrong usage of URI and parameters in request session.

For example:

self._access_token = f'?access_token={access_token}' if access_token else ''

and here

url = f'{self._url}/classification_systems{self._access_token}{self._language}'

You should use something like this

params = {"language": "pt-br"}
if self.access_token:
    params["access_token"] = self.access_token

session.get(SERVICE_RESOURCE_URL, params=params)

DO NOT manually concat these parameters in URL

Release version 0.2.0

Tasks:

  • Inform the right version in: lccs/version.py
  • Run all the tests.
  • Create a branch named: b-0.2.
  • From the branch b-0.2, create a tag named: v-0.2.0.
  • In the master branch increase version in lccs/version.py to 0.4.0
  • Notify users that a new version is released.

Release version 0.6.0

Tasks:

  • Inform the right version in: lccs/version.py
  • Run all the tests.
  • Create a branch named: b-0.6.
  • From the branch b-0.6, create a tag named: v-0.6.0.
  • In the master branch increase version in lccs/version.py to 0.8.0
  • Notify users that a new version is released.

Release version 0.4.0

Tasks:

  • Inform the right version in: lccs/version.py
  • Run all the tests.
  • Create a branch named: b-0.4.
  • From the branch b-0.4, create a tag named: v-0.4.0.
  • In the master branch increase version in lccs/version.py to 0.6.0
  • Notify users that a new version is released.

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.