Skip to content
This repository was archived by the owner on Dec 8, 2025. It is now read-only.

Record API constants#34

Merged
daffidwilde merged 7 commits intodev-0.0.1from
api-constants
Oct 27, 2023
Merged

Record API constants#34
daffidwilde merged 7 commits intodev-0.0.1from
api-constants

Conversation

@daffidwilde
Copy link
Copy Markdown
Contributor

Some basic information about the API is static, so it doesn't need to be called every time we need the information.

This PR does several things:

  • removes the costly calls from instantiation of the wrapper
  • puts the static data in a module that can be imported as constants
  • implements a workflow for checking our static data are current
  • starts writing some property-based tests for the wrapper

@daffidwilde daffidwilde merged commit 7fc4583 into dev-0.0.1 Oct 27, 2023
@daffidwilde daffidwilde deleted the api-constants branch October 27, 2023 13:46
daffidwilde added a commit that referenced this pull request Nov 29, 2023
* Set up GitHub Actions (#33)

* Add a basic CI workflow

* Fix syntax error in pyproject.toml

* Remove tkinter from dependencies (it's standard)

* Bump minimum Python version to 3.8

`pandas@2.0.3` requires Python 3.8+

* Separate dependencies

* Add lint-checker to CI

* Configure ruff and get linters to pass

* Update module names for tests

* Fix tests to reflect changes in implementation

* Run linters on source

* Remove erroneous check flag from ruff in CI

* Record API constants (#34)

* Write a test for creating an instance

* Create a file for the constants to live in

* Remove mention of constant data from API

* Add a workflow to check the constants every week

* Format wrapper module

* Format constants checker

* Add documentation for logger parameter

* Write tests for response processing

* Move response processor to use warnings

* Write test for get()

* Update doc-string for get()

* Write tests for table querist and its extractor

* Implement table querist

Rather than having a generic `query_api` method, it would be good to be
descriptive. Then we can have methods that match up with each endpoint
of the API

* Fix typos in strategies and doc-strings

* Format strategies test module

* Fix typo in constants checker

* Fix imports in api checker

* Remove summary functions

These can be found by making national-level queries for columns.

* Write tests for querying area type metadata

* Implement area type metadata querist

* Use area type querist in api checker

* Implement population querist (and valid test)

* Write test for invalid population types querist

* Write tests for one-shot areas querist

* Write areas querist helper tests

* Implement area types area querist and helper

* Refactor tests into single feature querist

No need for an area type and dimension querist when they do the same
thing at different endpoints.

* Write tests for generic category querist

* Implement querists for features and categories

* Finalise structure and clean things up (#38)

* Use new querists in checker; run it on dev pushes

* Add coverage to CI & fix typo in constants wflow

* Remove interface from __init__

* Fill out the rest of the QA checklist

* Rename constants workflow

* Remove cache directories from version control

* Write some documentation (#40)

* Update README and add a LICENSE file

* Update README to include limitations; fix URLs

* Add changelog and citation files

* Add in Quarto files (these may need changing)

* Update constants and checker error messages.

More Welsh area types have been added - excellent! I've also sorted the
collections in assertion errors.

---------

Co-authored-by: EdCussONS <148250246+EdCussONS@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant