Closed Rubix982 closed 3 years ago
For the above commits,
pipeline
and extract_properties
, and as such, examples that pipeline
extensively, there is the only part that will have to be configured going into the future, and that is the list of filter functions in the variable function_mapping
Usage
, and Imports
, and Test
, wherever possible. utils
under /tests/utils/
CC: @OmarMuhammedAli review please
Amazing work, @Rubix982 !!!!! I really enjoyed reviewing this PR. Can you share some resources that inspired you to apply the design decisions you used here?
Just the DRY principle suggested by someone called "Omar". I think you know him :wink:
[Feature] Utilities for extracting fields, filtering pipeline)
Pull Request Type
Purpose
To simply the filtering purpose, and for users who might want to extract only certain fields from a GeoJSON. I ran into a problem when testing requirement#2 where I just wanted to check the final
id
property across allfeatures
in a GeoJSON and did not need everything else, so I came up to write a simple function that does it for me.I noticed that the DRY principle was being violated with the filtering ideas. As we go on in the requirements, there are fields that are common across requirements, and can be also common with future requirements, that we would have to write the same code for over and over again - what if can automate that?
A pipeline does just that. It passes the data to the first filter it has received, then that output of that gets passed to the 2nd filter, then the output of the 2nd filter gets passed as the input to the 3rd filter.
Why?
The most important change that this PR introduces is the filtering pipeline which lets us reorganize, add, remove filters as simple objects, future demonstration will be worked on. This means if a filtering mechanism breaks or if we want to add a new one, it will be a simple addition, and then any future user or potential developer can just reuse this pipeline component
Feedback required over
Feedback required when
Whenever feasible
Mentions