-
-
Notifications
You must be signed in to change notification settings - Fork 4
feat: chart for splits set events #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
nya-elimu
merged 13 commits into
main
from
55-drips-generate-chart-for-each-splitsset-event-per-github-repo
Sep 22, 2024
Merged
Changes from 2 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
ed041ed
feat: chart for splits set events
nya-elimu 1f0cc0d
Merge branch 'main' into 55-drips-generate-chart-for-each-splitsset-e…
nya-elimu 11625b6
feat: add content repos
nya-elimu efbf87e
feat: add distribution repos
nya-elimu b16d095
feat: sort values based on the most recent split event
nya-elimu f505a25
refactor
nya-elimu cbd8f88
ci: drips-csvs
nya-elimu 555ae6c
refactor
nya-elimu f019f32
drips💧 nightly build
nya-elimu 6b2ad34
drips💧 charts
nya-elimu 95bceb4
Create requirements.txt
nya-elimu 1a0311f
Update requirements.txt
nya-elimu 045f461
Update README.md
nya-elimu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
*.js | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.