Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
9 changes: 9 additions & 0 deletions drips/charts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Charts

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

## Run the Python code

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

repos = [
# 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'
]
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:])

# splits_set_event_blocks = [18533142, 19533142, 20533142, 21533142, 22533142]
splits_set_event_blocks = splits_csv.columns[1:].values
print('splits_set_event_blocks:', splits_set_event_blocks)

# ethereum_addresses = [
# '0x5D388Ec24Cc2C0C77458338696aa63AFB706A7b1',
# '0xd46Cc93E3eE6a4fb532D9B48E95be7eD8f8f1DA0',
# '0x0000000000000000000000000000000000000000'
# ]
ethereum_addresses = splits_csv['ethereum_address'].values
print('ethereum_addresses: \n', ethereum_addresses)

# impact_percentages = [
# [30, 30, 35, 40, 30],
# [45, 45, 35, 35, 50],
# [25, 25, 30, 25, 20]
# ]
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_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_vitabu.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 @@
# 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