The CityJSON version verification is moved to the CityJSON.check_version method. This makes it easier to incorporate the cityjson parsing logic into other applications that import cjio.
Remove the click-dependent print_cmd_* warnings from the CityJSON methods and add a new warning system.
This PR is a mix of a few related changes.
Three things are refactored:
CityJSON.check_version
method. This makes it easier to incorporate the cityjson parsing logic into other applications that import cjio.print_cmd_*
warnings from the CityJSON methods and add a new warning system.CJ
The new warning system:
errors.CJWarning
is the new warning class https://github.com/cityjson/cjio/compare/develop...check-version?expand=1#diff-0b44b8f893fa10f0f8b8aa24c8353d80d149cbdf9d3d66f40cffbba75b9b5754R21-R30CJWarning(<message>).warn()
eg https://github.com/cityjson/cjio/compare/develop...check-version?expand=1#diff-d44b5fd731b079c54ac6e8593dc2680cbe9f7e83625689f812716f0a39e13961R420cjio
module eg https://github.com/cityjson/cjio/compare/develop...check-version?expand=1#diff-a01c473d7903a68c28ac73071f96eeecc72464a2f1d8269be9502026cd2ebfa0R82-R84cjio.print_cmd_*
function are extended to also print a list ofwarnings.WarningMessage
that are returned fromwarnings.catch_warnings(record=True)