-
Notifications
You must be signed in to change notification settings - Fork 5
Improve usage of version
parameter
#218
Comments
This changes the back-end behaviour of the version argument, as required by #218. Changes are only made to the resource function that looks at folder names. All other functionality using this is currently failing.
In relation to #218 A lot of the changed code is fixed to 2.02 as this was the previous implementation. This will need changing.
This adds a level of complexity to usage since it may require a level of try-except on NOTE: The |
With
As such, a method needs to be determined to: guarantee that a single value will be returned into the future; or have a different API once SemVer appears. The former of these options is preferable since it reduces the changes required in the future. A method that returns a list with a known order is not a suitable solution since when there is a single item there are multiple ways to access it (it's both the first and last item on the list). Requiring one of these over the other does not lead to an intuitive interface. As such, a For example:
|
Based on fleshing out the above in #258, I'd suggest that rather than being a flag, there should be separate helper functions that perform the action of returning a single |
At the moment, this returns a list with a single Ruleset. It will do more as #218 is progressed.
At the moment, this returns a list with a single Ruleset. It will do more as #218 is progressed.
Decorators should probably be used to deal with how versions are processed by functions. Doing it internally to functions isn't very DRY and leads to fairly complex and confusing code. |
If you make a constant As such, the value should currently be a string with some value. |
This allows '==' to be used to check whether a value is this or not, rather than requiring use of 'is'. By doing this, it gives more scope to change the value in the future. A constant has been added to contain this value, and should be used if this meaning is required. For original explanation for change, see: #218 (comment)
The
Finalisation of this should be undertaken within the scope of #265. |
At the moment a number of functions take a
version
parameter to specify the version of IATI data to access. The current situation only allows specification of Decimal Versions. When unspecified, it defaults to the latest version. This has multiple problems.As such, the following changes should be made:
1.04
,1.05
,2.01
) to return information from that specific version.1
,2
). This will return information that is applicable to all Decimal Versions within the Integer Version. If no data matches this, it will return information for the latest Decimal Version within the Integer Version.None
to meanversion-independent
(the folder name for relevant data).iati.constants.STANDARD_VERSION_LATEST
must be used instead.ValueError
will be raised.The text was updated successfully, but these errors were encountered: