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

DATASET: Air pollution data #309

Merged
merged 4 commits into from
Aug 14, 2023
Merged

DATASET: Air pollution data #309

merged 4 commits into from
Aug 14, 2023

Conversation

alexander-griffen
Copy link
Contributor

Fixes #180

Implementation notes

Data import of various air pollution data models Defra have produced (that I assume are the basis for some of the data mentioned in the ticket). This data was recorded in 2021.

The geo-matching was performed in GIS, and uploaded to the Drive (explained in more detail in 934f547).

Subscript is currently handled as follows:

  • In a dropdown, it's in plain-text shorthand
image
  • When displayed in a table, the subscript is rendered using a custom filter
    image

Next steps

The table (image above) could include more detail on the metric. Below is it as a separate column to show the relevant data (which is stored in the description attribute of the DataType object), although that column isn't present in the code, because it looks bad. The subscript and superscript is present as unicode here, so shouldn't require fancy handling.
image

@codecov
Copy link

codecov bot commented Aug 1, 2023

Codecov Report

Merging #309 (5a313ac) into main (43b26dc) will decrease coverage by 0.09%.
The diff coverage is 69.23%.

❗ Current head 5a313ac differs from pull request most recent head 8243066. Consider uploading reports for the commit 8243066 to get more accurate results

@@            Coverage Diff             @@
##             main     #309      +/-   ##
==========================================
- Coverage   84.68%   84.59%   -0.09%     
==========================================
  Files          75       76       +1     
  Lines        2500     2512      +12     
  Branches      249      250       +1     
==========================================
+ Hits         2117     2125       +8     
- Misses        323      326       +3     
- Partials       60       61       +1     
Files Changed Coverage Δ
hub/views/explore.py 63.54% <0.00%> (-1.36%) ⬇️
hub/templatetags/hub_filters.py 78.94% <60.00%> (-2.88%) ⬇️
hub/migrations/0042_add_dataset_release_date.py 100.00% <100.00%> (ø)
hub/models.py 71.97% <100.00%> (+0.08%) ⬆️
hub/tests/test_admin.py 100.00% <100.00%> (ø)

Copy link
Member

@zarino zarino left a comment

Choose a reason for hiding this comment

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

@alexander-griffen Hope you don’t mind, I’ve added a commit that changes how this data is presented in the front end. Should probably squash my commit into your second commit, before merging.

struan and others added 3 commits August 14, 2023 10:32
So we can keep track of, and display, when the data was released.
The file which is used to match the 'gridcode' value to the constituency
code was created using shapefiles of constituencies re-projected onto
the same projection as the defra data (BNG 27700), and one example of
the gridcodes to x and y values as found from an arbitrary input file
for this import. QGIS was used to find where the points were within the
boundaries of the constituencies, and indeed which constituencies. To
prevent this process having to be repeated, the output file is stored
in the Drive
@struan struan force-pushed the 180-air-quality-data branch from eba5266 to 5a313ac Compare August 14, 2023 09:37
This change includes an addition of a filter, which allows for rendering
of subscript written in shorthand
(https://pages.uoregon.edu/ncp/Courses/MathInPlainTextEmail.html).

Currently, this new filter only works if there is only one instance of
subscript, and that it's at the end of the string.
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.

Air quality / pollution data
3 participants