Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.

Here's a numpy example from a numpy tutorial on doing AQI #79

Merged
merged 2 commits into from
Mar 7, 2022

Conversation

skrawcz
Copy link
Collaborator

@skrawcz skrawcz commented Feb 16, 2022

See https://github.com/numpy/numpy-tutorials/tree/main/content
for where this is pulled from.

The names of the functions could be better I think. Otherwise this
doesn't seem like a bad pipeline. Versus doing this analysis in a notebook,
the strength of Hamilton here is in forcing concise definitions and language
around steps in the analysis -- and then magically the analysis is pretty
reusable / very easy to augment.

E.g. add some @config.when or split things into python modules to be swapped out.

Additions

  • example showing using pure numpy code.

Removals

  • N/A

Changes

  • N/A

Testing

  1. Script runs with python run_analysis.py

Notes

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Code follows the standards laid out in the TODO link to standards
  • Passes all existing automated tests
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future todos are captured in comments
  • Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)
  • Reviewers requested with the Reviewers tool ➡️

Testing checklist

Python

- [ ] python 3.6

  • python 3.7

See https://github.com/numpy/numpy-tutorials/tree/main/content
for where this is pulled from.

The names of the functions could be better I think. Otherwise this
doesn't seem like a bad pipeline. Versus doing this analysis in a notebook,
the strength of Hamilton here is in forcing concise definitions and language
around steps in the analysis -- and then magically the analysis is pretty
reusable / very easy to augment.

E.g. add some @config.when or split things into python modules to be swapped out.
Copy link
Collaborator

@elijahbenizzy elijahbenizzy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. I think this is actually a great use for validators on the shape of the data, given that typing is just np.ndarray

Hopefully that makes the example clearer.
@elijahbenizzy
Copy link
Collaborator

Adding some end-to-end tests could be nice -- this could be an integration test

Copy link
Collaborator

@elijahbenizzy elijahbenizzy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants