BritishGeologicalSurvey / pyagsapi

pyagsapi - An AGS Utilities API with AGS v4.x Schema Validation & Converter for .ags<-->.xslx files
https://britishgeologicalsurvey.github.io/pyagsapi/
GNU Lesser General Public License v3.0
12 stars 2 forks source link

Validate uk outline #45

Closed volcan01010 closed 3 years ago

volcan01010 commented 3 years ago

This merge request adds two new tests to the BGS rules:

These rules are described in #21.

I've used a different way to implement these checks, where I define a checking function and use df.apply() to run it on each row. It only works where validation happens within a single row, but has the benefit that you get the Row ID out in the error message. We can't use line numbers in the BGS checks because the dataframes don't record them.

It also forces conversion of the coordinate columns into numeric types, even if they are marked with type X. This fixes a bug where real files were failing with "Can't convert string to float" errors.

To test: