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

all local and parl elections assume England & Wales rules #1

Open
chris48s opened this Issue Feb 23, 2019 · 5 comments

Comments

Projects
None yet
2 participants
@chris48s
Copy link

chris48s commented Feb 23, 2019

Hello. Just having a nose about :)

if election_type in ["local", "parl"]:
return poll_date - working_days(19)

Assumes that all local and parl elections use the England & Wales rules, but in reality I think local.highland.wester-ross-strathpeffer-and-lochalsh.by.2018-12-06 should have a different SOPN date from local.surrey.the-byfleets.by.2018-12-06 (for example) even though they are both local.%.2018-12-06.

In a case where the country/territory isn't implicit in the election type, it would be useful if it were possible to pass that in as a param.

@mrwilson

This comment has been minimized.

Copy link
Owner

mrwilson commented Feb 23, 2019

That's a great point. I'm trying to accumulate edge-cases like this as tests.

I'm thinking an API change like:

publish_date = sopn_publish_date(
  'local.highland.wester-ross-strathpeffer-and-lochalsh.by.2018-12-06',
  country='scotland'
)

Where country is default None.

@chris48s

This comment has been minimized.

Copy link
Author

chris48s commented Feb 23, 2019

I'm trying to accumulate edge-cases

You want edge cases.. I got edge cases 😆

I'm thinking an API change like...

Yep, so for the following election types, country is implicit: gla, naw, nia, sp
and something like sopn_publish_date('sp.c.aberdeen-central.2016-05-05', country='england') would be complete nonsense.

Conversely, local, parl, pcc and in principle mayor are all non-country-specific so country should be required.

This makes the interface a bit clumsy because sometimes country is a required param, but sometimes it makes no sense to provide it. There is also the case where you have a group id like parl.2017-06-08 which includes ballots in multiple countries.

Given all that, would it make more sense for sopn_publish_date() to just take a date and a country, as opposed to an election id? Is the ID actually used for anything other than extracting the date?

@mrwilson

This comment has been minimized.

Copy link
Owner

mrwilson commented Feb 24, 2019

Re: why election id, my first attempt was to actually pass in an election type and date (as datetime) but I thought a single-input API was cleaner if it contained the same information.

However, as determining country from election location is slightly out of scope for this project, taking a date and a country would be fine.

The important thing is utility.

@mrwilson

This comment has been minimized.

Copy link
Owner

mrwilson commented Feb 27, 2019

From doing a bit of digging, it looks like it depends solely on country.

  • It's 23 working days in scotland (using the scottish public holiday calendar)
  • It's 19 working days in England/Wales (using E/W public holidays)
  • It's 19 working days in Northern Ireland (using NI public holidays)

Can you think of any other weird edge cases? pcc elections follow the rules for country too, at a glance.

@mrwilson

This comment has been minimized.

Copy link
Owner

mrwilson commented Feb 27, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.