Skip to main content

Snark Hub

Project description

DataFlow · SnarkAI

Prototyping for Hub Dataflow

Setup

  1. Install the package
> pip3 install git+https://github.com/snarkai/dataflow@v0.2.2

Make sure gdal and opencv is installed as required by image_io.py

  1. Setup credentials in the local folder and don't forget to put those in .gitignore
.secrets/agmri.cfg
.secrets/intelinair #AWS credentials
  1. Example to get started
from dataflow import hub
import torch

hub.init()

df = hub.agmri().get_polygons_by_type(hub.agmri.UIUC_ENDROW, max=1) 
ds = hub.polygon_sampler(df, sample_count=32, shape=(1024,1024,4))
ds[0]

Troubleshooting

Install GDAL and OpenCV

If it throws error on gdal or opencv install those manually

./bin/prepare.sh
./bin/gdal.sh
./bin/opencv.sh

Credentials examples

intelinair file should look like this

[default]
aws_access_key_id = ...
aws_secret_access_key = ...
region = us-east-1

agmri.cfg

[production]
admin_username = ...
admin_password = ...

Known Issues

[ ] Credentials are not flexible where to be stored

Push a new version

git commit -a -m 'current changes'
git tag -a 'v0.2.2' -m 'some message here'
git push origin 'v0.2.2' 

Automated integration testing

To run pytest before git push we need to do create .git/hooks/pre-push file with the following content:

#!/bin/bash
docker-compose run test

And make it executable

chmod +x .git/hooks/pre-push

Also whenever updating requirements.txt and options.txt please rebuild the test

docker-compose build test

Formatting and Linting

Hub uses Black and Flake8 to ensure a consistent code format throughout the project. Replace .vscode/settings.json content withthe following:

{
    "[py]": {
        "editor.formatOnSave": true
    },
    "python.formatting.provider": "black",
    "python.linting.flake8Enabled": true,
    "python.linting.flake8Path": "flake8",
    "python.linting.flake8Args": [
        "--max-line-length=80",
        "--select=B,C,E,F,W,B950",
        "--ignore=E203,E501,W503"
    ],
    "python.linting.pylintEnabled": false,
    "python.linting.enabled": true,
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hub_dataflow-0.9.4.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hub_dataflow-0.9.4-py3-none-any.whl (35.3 kB view details)

Uploaded Python 3

File details

Details for the file hub_dataflow-0.9.4.tar.gz.

File metadata

  • Download URL: hub_dataflow-0.9.4.tar.gz
  • Upload date:
  • Size: 24.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.1.3 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.9

File hashes

Hashes for hub_dataflow-0.9.4.tar.gz
Algorithm Hash digest
SHA256 3a8283ad82ddc1e850ef013ddad0ef2291a66d02cc8bbc570752c177fc20f5b9
MD5 4abb1d33deb19ec69511020ce62b86d6
BLAKE2b-256 5be85f8eb03a748542705e0f787dd5a49ed8894430c933f25cce2c34b7b9fbfd

See more details on using hashes here.

File details

Details for the file hub_dataflow-0.9.4-py3-none-any.whl.

File metadata

  • Download URL: hub_dataflow-0.9.4-py3-none-any.whl
  • Upload date:
  • Size: 35.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.1.3 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.9

File hashes

Hashes for hub_dataflow-0.9.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4fbd1c4dc0eb01544778788f1ea95c6c321fa2c2dab81e3351a8c6c9fc632231
MD5 024c986a35594a23b7c6b1a61df0cdfb
BLAKE2b-256 ce018115bece8926de343b38743915d4cb0da64d3893c78253d47aff74c3e0ea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page