Compare commits

..

No commits in common. "0643fe969d754809c70ac4f0b2ccbb8725987540" and "e0923e6cb50c232a93dd24f97ab66ab69a7e0aaa" have entirely different histories.

7 changed files with 17 additions and 113 deletions

View file

@ -1,14 +1,8 @@
## [DannyDannyDanny/Methodology](https://github.com/DannyDannyDanny/methodology/) ## [DannyDannyDanny/Methodology](https://github.com/DannyDannyDanny/methodology/)
Conventions:
* [conventional comments](https://conventionalcomments.org/)
* [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/)
* [conventional branch](https://conventional-branch.github.io/)
This guide focuses on designing, developing ~~and delivering~~ Data-Processing Sytems, written primarily in python, deploying to Linux servers, optionally communicating with external interfaces (APIs or DBs). The repo is actively being updated; _bookmark_ :bookmark: it, leave a _Star_ :star: or _Watch_ :eye: the repo. This guide focuses on designing, developing ~~and delivering~~ Data-Processing Sytems, written primarily in python, deploying to Linux servers, optionally communicating with external interfaces (APIs or DBs). The repo is actively being updated; _bookmark_ :bookmark: it, leave a _Star_ :star: or _Watch_ :eye: the repo.
* [repo roadmap](#roadmap) * [repo roadmap](#roadmap)
* 🔴🟡🟢 [example process roadmap](example_progress_roadmap.md)
* [gitmoji](#gitmoji-reference) * [gitmoji](#gitmoji-reference)
* [planning](project_planning_contracting.md) * [planning](project_planning_contracting.md)
* ideation / design (coming soon) * ideation / design (coming soon)
@ -18,9 +12,8 @@ This guide focuses on designing, developing ~~and delivering~~ Data-Processing S
* Deployment (coming soon) * Deployment (coming soon)
* Launch (coming soon) * Launch (coming soon)
* Maintenance (coming soon) * Maintenance (coming soon)
* [cloud engineering](cloud-engineering.md)
* [data management](data_storage.md) * [data management](data_storage.md)
* [tools](tools.md) :construction: * [tools](tools.md) (:construction: under construction :construction:)
* [philosophy](philosophy.md) * [philosophy](philosophy.md)
* [scripts](scripts/) * [scripts](scripts/)
* [emoji_shortlist](scripts/emoji_shortlist.py) * [emoji_shortlist](scripts/emoji_shortlist.py)

View file

@ -1,3 +0,0 @@
# Cloud Engineering
* [general guidance](https://www.lockedinspace.com/posts/001.html)

View file

@ -1,44 +0,0 @@
## Datasets
Which datasets are in the cloud?
🔴 - dataset in cloud
🟡 - dataset migration in progress
🟢 - dataset entirely migrated
* Dataset1
* 🟢 Dataset2
* 🟢 Dataset 2
* 🟡 Dataset 3
* 🔴 Dataset 4
* 🔴 Dataset 5
* 🔴 Dataset 6
* 🔴 Dataset 7
## Projects
What projects are fully in the cloud?
🔴 - project not in cloud
🟡 - project migration in progress
🟢 - project entirely in cloud
* 🟢 Project 1
* 🟡 Project 2
* 🟡 Project 3
* 🔴 Project 4
* 🔴 Project 5
## Users
Who is in the cloud?
🔴 - no projects in cloud
🟡 - some projects in cloud
🟢 - all projects in cloud
* 🟢 User 1
* 🟢 User 2
* 🟡 User 3
* 🟡 User 4
* 🔴 User 5

View file

@ -1,2 +1,2 @@
# Index For methodology/VIMWIKI # Index For VIMWIKI
* [readme.md](README.md) * [readme.md](README.md)

View file

@ -1,14 +1,6 @@
### Development ### Development
* Development Cycle [Agile](https://www.atlassian.com/agile/scrum/sprints) * Development Cycle [Agile](https://www.atlassian.com/agile/scrum/sprints)
#### Backlog Refinement
* Fibonacci Story Points: 1 2 3 5 8 13 20 40 100
* Each Story should have an epic
* Example Description:
* **Background**: Who? Why? What? How?
* **Expected Outcome**: measurable change from before / after completion.
* **Dependencies**: descriptions / approval from ABC / acceptance criteria / uaser acceotance testing
## Development Infrastructure ## Development Infrastructure
* **[Setup Dev Machine](setup-dev-machine.md)** * **[Setup Dev Machine](setup-dev-machine.md)**
* **Setup Environments** * **Setup Environments**
@ -25,7 +17,6 @@
* Setup [Travis-CI build testing](https://docs.travis-ci.com/user/customizing-the-build/#building-specific-branches) * Setup [Travis-CI build testing](https://docs.travis-ci.com/user/customizing-the-build/#building-specific-branches)
* Add an [`.EditorConfig` file](https://editorconfig.org/) * Add an [`.EditorConfig` file](https://editorconfig.org/)
* Add [git commit template](https://gist.github.com/lisawolderiksen/a7b99d94c92c6671181611be1641c733#file-git-commit-template-md) * Add [git commit template](https://gist.github.com/lisawolderiksen/a7b99d94c92c6671181611be1641c733#file-git-commit-template-md)
* Branching strategy: small teams might want to adopt [trunk based development](https://trunkbaseddevelopment.com/)
* **Documentation** * **Documentation**
* Your repo should have a one-liner for isntallation andd running: (docker-compose.yml + `doco up`) * Your repo should have a one-liner for isntallation andd running: (docker-compose.yml + `doco up`)
@ -86,9 +77,6 @@ git log --follow -- filename
# search code in all history # search code in all history
git log -S "some_old_varname" --oneline --all git log -S "some_old_varname" --oneline --all
# files changed on your branch compared to origin/main i.e. **files changed** in a Github PR
git diff --name-only origin/main
``` ```
### Submitting multiple PRs ### Submitting multiple PRs

View file

@ -1,46 +1,3 @@
## database file-caching
```
from pathlib import Path
from snowflake.connector import connect
import pandas as pd
import hashlib
def get_df(query, env, use_cache=True):
print(f'{query[:100] = }')
if env == "prod":
role = "COSUTMER"
warehouse = "CLOWN_COSTUMES"
elif env == "sand":
role = "CUSTOMER"
warehouse = "CUSTOMER_INFORMATION"
else:
raise ValueError(f"env must be prod or sand - recieved: {env}")
hash_query_4_digits = hashlib.shake_128(query.encode()).hexdigest(4)
cache_pkl_path = Path(f"/tmp/cache-{env}-{hash_query_4_digits}.pkl")
print(cache_pkl_path.exists(), cache_pkl_path)
if cache_pkl_path.exists() and use_cache:
print('loading cached data')
df = pd.read_pickle(cache_pkl_path)
return df
print("fetching & caching data")
with connect(
authenticator="externalbrowser",
user="user@company.com",
account=f"company-{env}",
role=role,
warehouse=warehouse,
) as con:
cur = con.cursor()
cur.execute(query)
df = cur.fetch_pandas_all()
df.to_pickle(cache_pkl_path)
return df
```
## Python Kernel Management ## Python Kernel Management
``` ```
# install new kernel "my_new_env" # install new kernel "my_new_env"

View file

@ -1,4 +1,17 @@
# Dev Machine # Dev Machine
This page is made redundant by: [DannyDannyDanny/dotfiles](https://github.com/DannyDannyDanny/dotfiles) 🚧 I'm currently in the process of [switching to Linux](https://github.com/DannyDannyDanny/methodology/issues/5).
> TODO: delete this page
🧤 Get comfortable with these tools on a system you are familiar with like MacOS or Windows (via Windows-Subsystem-Linux).
| Tool |Linux-Compatible | MacOS-compatible | Description |
|--- |--- | --- | --- |
| [`zsh`](https://www.zsh.org/) + [omz](https://github.com/ohmyzsh/ohmyzsh) | ✅ | ✅ | Preferred Shell + Configurator |
| [`lf`](https://github.com/gokcehan/lf) | ✅ | ✅ | CLI file browser |
| [`vim`](https://github.com/gokcehan/lf) | ✅ | ✅ | CLI text editor |
| ~[`mutt`](http://www.mutt.org/)~ | ✅ | ✅ | ~CLI email client~ (just use a browser for now) |
🔖 Further reading:
* [Unix as IDE](https://blog.sanctum.geek.nz/series/unix-as-ide/)
* [LARBS progs.csv](https://github.com/LukeSmithxyz/LARBS/blob/master/progs.csv)