-
Notifications
You must be signed in to change notification settings - Fork 6
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
Split mapping #127
Split mapping #127
Conversation
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.
LGTM in general - fix the small issues and I'll approve and merge afterwards
self.aggregated_data_dir = io_dir / 'blocks_per_entity' | ||
self.aggregated_data_dir.mkdir(parents=True, exist_ok=True) | ||
|
||
def aggregate(self, timeframe): |
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.
I find it a bit confusing to name both functions in the same file aggregate
. You could rename this one process
. Don't have strong feelings though, so leaving it like that is also fine.
@@ -20,7 +19,7 @@ def map_from_known_identifiers(self, block): | |||
""" | |||
block_identifier = block['identifiers'] | |||
day = block['timestamp'][:10] | |||
pool_links = hlp.get_pool_links(self.project_name, day) | |||
pool_links = hlp.get_pool_links(self.project_name, day) # todo move out of method after updating cardano data |
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.
What is this todo about? I suggest you open a gh issue instead.
@@ -0,0 +1,18 @@ | |||
# Aggregator |
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.
You need to activate this page in mkdocs.yml
as well.
All Submissions:
Description
Split "mapping" into two modules, mapping and aggregation. Now the mapping is only responsible for mapping blocks to entities (and is not dependent on any timeframe), while the aggregator generates the files with information about the distribution of resources to entities for some timeframe.
Also replaced file reading / writing method (json and csv methods instead of simple string parsing) for clarity and easier testing / maintenance.
Left to do: