Skip to main content

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,
}

Metadata

Release files for dataflow-gegham-test 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dataflow-gegham-test 0.9.0
File Size Uploaded
dataflow_gegham_test-0.9.0.tar.gz 22.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dataflow-gegham-test 0.9.0
File Interpreter ABI Platform
dataflow_gegham_test-0.9.0-py3-none-any.whl Python 3 none any Details

Total release size: 52.3 kB

Release files / dataflow_gegham_test-0.9.0.tar.gz

Download URL dataflow_gegham_test-0.9.0.tar.gz
Size 22.1 kB
Tags Source
SHA-256 checksum
How to use checksums
56a5eb798f01a7eaf7d0946ac9eb871ae7dc71b727ccea7a193368073551727e
BLAKE2b-256 checksum
How to use checksums
546ae455e37e73139a145a3480620352b87e78bc05f51aef608236b0082fb870
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.9

Release files / dataflow_gegham_test-0.9.0-py3-none-any.whl

Download URL dataflow_gegham_test-0.9.0-py3-none-any.whl
Size 30.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f3f74fd2642406d5b7d76a45259695d82ff73c6af73e0525121087cf683b55b8
BLAKE2b-256 checksum
How to use checksums
961c0a08cfcb9d8bc23c73849bc7fd751308240677e51e072eb196a91e389275
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.9

Release history Release notifications | RSS feed

This release

0.9.0 This release

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page