Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/drips-charts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Drips💧 Charts

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]

defaults:
run:
working-directory: drips/charts

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Generate Charts
run: |
python generate-charts.py
43 changes: 43 additions & 0 deletions .github/workflows/drips-csvs-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Drips💧 CSVs - Nightly

on:
schedule:
- cron: 49 23 * * *

jobs:
build:

runs-on: ubuntu-latest

defaults:
run:
working-directory: drips/csvs

steps:
- uses: actions/checkout@v4

- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'
cache-dependency-path: drips/csvs/package-lock.json

- run: npm ci
- run: npx tsc

- run: node query-events.js

- name: Git Config
run: |
git config user.name 'Nya Ξlimu'
git config user.email 'info@elimu.ai'

- name: Git Commit
run: |
git add *.csv
git commit -m 'chore(drips💧): nightly build' --allow-empty
Comment on lines +36 to +39
Copy link
Contributor

Choose a reason for hiding this comment

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

Address the actionlint suggestion to avoid issues with file names containing dashes.

Actionlint suggests using ./*glob* or -- *glob* to avoid potential issues with file names containing dashes. Please update the git add command accordingly.

Apply this diff to fix the issue:

-        git add *.csv
+        git add -- *.csv
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Git Commit
run: |
git add *.csv
git commit -m 'chore(drips💧): nightly build' --allow-empty
- name: Git Commit
run: |
git add -- *.csv
git commit -m 'chore(drips💧): nightly build' --allow-empty
Tools
actionlint

37-37: shellcheck reported issue in this script: SC2035:info:1:9: Use ./glob or -- glob so names with dashes won't become options

(shellcheck)


- name: Git Push
run: |
git push
32 changes: 32 additions & 0 deletions .github/workflows/drips-csvs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Drips💧 CSVs

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

defaults:
run:
working-directory: drips/csvs

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: drips/csvs/package-lock.json
- run: npm ci
- run: npx tsc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Node.js CI - Nightly
name: Funding Splits - Nightly

on:
schedule:
- cron: 59 23 * * *

jobs:
nightly_build:
build:

runs-on: ubuntu-latest

Expand All @@ -26,7 +26,7 @@ jobs:
- run: npm ci
- run: npx tsc

- run: node ./query-events.js
- run: node query-events.js

- name: Git Config
run: |
Expand All @@ -36,7 +36,7 @@ jobs:
- name: Git Commit
run: |
git add *.csv
git commit -m 'chore(distribution): nightly build' --allow-empty
git commit -m 'chore(funding-splits): nightly build' --allow-empty

- name: Git Push
run: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Node.js CI
name: Funding Splits

on:
push:
Expand Down
9 changes: 9 additions & 0 deletions drips/charts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Drips Charts

> Charts based on the CSVs in [`../csvs/`](../csvs/)

## Run the Python code

```python
python generate-charts.py
```
90 changes: 90 additions & 0 deletions drips/charts/generate-charts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import matplotlib.pyplot as plt
import os
import pandas

repos = [
# content.elimu.eth
'crowdsource',
'webapp',

# engineering.elimu.eth
'content-provider',
'keyboard',
'kukariri',
'ml-event-simulator',
'ml-storybook-reading-level',
'ml-storybook-recommender',
'model',

# reading.engineering.elimu.eth
'VoltAir',
'familiar-word-reading',
'herufi',
'image-picker',
'silabi',
'sound-cards',
'storybooks',
'visemes',
'vitabu',
'walezi-android',

# writing.engineering.elimu.eth
'chat',
'handwriting-letters',
'handwriting-numbers',

# math.engineering.elimu.eth
'CameraColorPicker',
'android_packages_apps_Calculator',
'missing-number',
'nambari',
'nyas-space-quest',
'nyas-space-quest-qd',
'shapi',
'soga',
'tilt-game',

# distribution.elimu.eth
'analytics',
'appstore',
'launcher',
'ml-authentication',
'start-guide',
'website',
'web3-sponsors',
]
for repo in repos:
print()
print('repo:', repo)

csv_path = f'../csvs/splits_{repo}.csv'
print('csv_path:', csv_path)
if not os.path.isfile(csv_path):
print('\033[93m' + 'File not found' + '\033[0m')
continue

splits_csv = pandas.read_csv(csv_path)
print('splits_csv: \n', splits_csv)
print('splits_csv.columns:', splits_csv.columns)
print('splits_csv.columns[1:]:', splits_csv.columns[1:])

# Sort values based on the most recent split event
last_column = splits_csv.columns[-1]
print('last_column:', last_column)
splits_csv = splits_csv.sort_values(by=last_column, ascending=False)
print('splits_csv: \n', splits_csv)

splits_set_event_blocks = splits_csv.columns[1:].values
print('splits_set_event_blocks:', splits_set_event_blocks)

ethereum_addresses = splits_csv['ethereum_address'].values
print('ethereum_addresses: \n', ethereum_addresses)

impact_percentages = splits_csv[splits_set_event_blocks].values
print('impact_percentages: \n', impact_percentages)

plt.figure(figsize=(12.8, 4.8))
plt.stackplot(splits_set_event_blocks, impact_percentages, labels=ethereum_addresses)
plt.legend(loc='center left', bbox_to_anchor=(1, 0.5))
plt.tight_layout()
plt.savefig(f'splits_{repo}.png')
Binary file added drips/charts/splits_VoltAir.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added drips/charts/splits_analytics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added drips/charts/splits_appstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added drips/charts/splits_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added drips/charts/splits_nyas-space-quest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added drips/charts/splits_soga.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added drips/charts/splits_start-guide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added drips/charts/splits_vitabu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added drips/charts/splits_webapp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added drips/charts/splits_website.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions drips/csvs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
*.js
Copy link
Contributor

Choose a reason for hiding this comment

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

Reconsider ignoring all JavaScript files.

Ignoring all JavaScript files in the drips/csvs/ directory might lead to unintended consequences. If there are any JavaScript files in this directory that are required for functionality, they will not be tracked by version control, which could lead to missing files or broken functionality when the code is deployed or shared with others.

Consider removing the *.js entry unless there is a specific reason for ignoring all JavaScript files in this directory. If there are specific JavaScript files that need to be ignored, you can add their filenames or patterns instead of ignoring all .js files.

21 changes: 21 additions & 0 deletions drips/csvs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Drips CSVs

> CSVs with data per split event

## Install Dependencies

```bash
npm install
```

## Run the TypeScript Compiler

```bash
npx tsc
```

## Run the JavaScript

```bash
node query-events.js
```
Loading
Loading