Skip to content

Conversation

@LauraAntunes1
Copy link
Contributor

No description provided.

Copy link
Member

@LadyChristina LadyChristina left a comment

Choose a reason for hiding this comment

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

Looks great overall but there are a few things I'd recommend revisiting, especially documentation-wise (see comments)

Collect geodata for Cardano relay nodes.
"""
import json
import os
Copy link
Member

Choose a reason for hiding this comment

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

Unused import

relay_targets = set()
for pool_id, relays in pool_relays.items():
for relay in relays:
ip = relay.get('ipv4')
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to have cases where only ipv6 is set? What would happen then?

skipped = 0
new_entries = 0
for node_ip in relay_targets:
if node_ip.endswith('onion'):
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps worth keeping a separate list with onion addresses? Or at least keeping track of how many there are and logging it

@@ -0,0 +1,147 @@
"""
Collect geodata for Cardano relay nodes.
Copy link
Member

Choose a reason for hiding this comment

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

It would be good to have a couple more sentences here that explain the steps that are followed for this, e.g. that onion addresses are skipped etc. (It would be fine to have that somewhere else too, e.g. in the README but I think it should be at least in one place).

# Remove trailing punctuation (commas, periods, etc.)
name = name.rstrip('.,;:')

# Special rules for specific providers
Copy link
Member

Choose a reason for hiding this comment

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

Not a big deal but this could be a dictionary that is iterated through (I would definitely suggest making this change if adding more names in the future)

@@ -0,0 +1,270 @@
"""
Parse Cardano geodata and create CSV files for plotting.
Copy link
Member

Choose a reason for hiding this comment

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

Again it would be good to have some more info as to how parsing is done, e.g. how unknown hosts are handled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants