Skip to content
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

Add README for unstable position data interface #15609

Merged
merged 1 commit into from
Feb 21, 2017

Conversation

chrismytton
Copy link
Contributor

What does this do?

This adds a section to the README with details on the expected interface for using the unstable position data.

Why was this needed?

We want to add an interface for interacting with unstable position data to viewer-sinatra. This interface is an extension to the EveryPolitician::Popolo::Person class, which operates on the
unstable/positions.csv file in a legislature's directory in everypolitician-data.

Relevant Issue(s)

Part of #15606

Implementation notes

I was originally going to add the positions method to the Legislature, but that doesn't really make sense, as it's people that hold positions, so that's where I've ended up putting the method.

In the (very near) future we'll be adding methods for filtering positions to just those that fall between two dates, so that we can show positions for a particular term. But for now this interface should give us enough to get off the ground.

@tmtmtmtm tmtmtmtm temporarily deployed to everypolitician-viewe-pr-15609 February 21, 2017 10:30 Inactive
Copy link
Contributor

@tmtmtmtm tmtmtmtm left a comment

Choose a reason for hiding this comment

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

In principle this looks good, though it would be better to have an example that actually exists in the current positions.csv data, which was migrated to the new approach (and now only holds Cabinet data) in everypolitician/everypolitician-data#26264

README.md Outdated

### Interacting with unstable position data

We use data from the `unstable/positions.csv` file in a legislature's directory to display cabinet positions on the website. Because this data is unstable there currently aren't methods in [the `everypolitician` gem](https://github.com/everypolitician/everypolitician-ruby) for interacting with it, so viewer-sinatra has some of its own classes for dealing with it. These classes live in the `lib/everypolitician_extensions.rb` file and are documented below.
Copy link
Contributor

Choose a reason for hiding this comment

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

not specifically an issue here, but just for explicit clarity, it's not only because the file lives in unstable/ that we can't interact with it from the gem — it's that the way we store this data will change. The positions.csv is just a very quick hack to let us get up and running — we still need to work out how exactly we're going to store this sort of information, and the answer may not even be within the legislature at all.

@chrismytton chrismytton force-pushed the 15606-method-to-access-legislature-positions branch from 8c3afaf to 43c9bbf Compare February 21, 2017 11:02
@tmtmtmtm tmtmtmtm temporarily deployed to everypolitician-viewe-pr-15609 February 21, 2017 11:02 Inactive
We want to add an interface for interacting with unstable position data
to viewer-sinatra. This interface is an extension to the
`EveryPolitician::Legislature` class, which operates on the
`unstable/positions.csv` file in a legislature's directory in
everypolitician-data.
@chrismytton
Copy link
Contributor Author

In principle this looks good, though it would be better to have an example that actually exists in the current positions.csv data, which was migrated to the new approach (and now only holds Cabinet data) in everypolitician/everypolitician-data#26264

Ah yep, I've updated the example to use the latest data.

As discussed in Slack, I've also changed this to talk about memberships instead of positions and to make this specifically about adding a cabinet_positions method.

@chrismytton chrismytton requested a review from tmtmtmtm February 21, 2017 11:06
Copy link
Contributor

@tmtmtmtm tmtmtmtm left a comment

Choose a reason for hiding this comment

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

👍

I suspect this will still need to evolve over time, but this should isolate us from underlying changes to the data for a while anyway.

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