Skip to content
This repository has been archived by the owner on Nov 17, 2022. It is now read-only.

Improve version argument in **/resources.py #255

Closed

Conversation

hayfield
Copy link
Contributor

@hayfield hayfield commented Nov 28, 2017

Brings use of version argument in **/resources.py in line with #218


Tasks

resources.py

get_x_paths()

  • get_codelist_paths()
    • Version-independent: Number of NE Codelists relating to everything (to become Replicated)
    • Integer: Number of NE Codelists relating to Integer
    • Decimal: Number of Embedded and NE Codelists relating to version
  • get_codelist_mapping_paths()
    • Version-independent: ValueError
    • Integer: Number of Mapping Files for all Decimals at a given Integer
    • Decimal: Number of Mapping Files at each version
  • get_ruleset_paths()
    • Version-independent: ValueError
    • Integer: Number of Rulesets for all Decimals in given Integer
    • Decimal: Number of Rulesets at each version
  • get_all_schema_paths()
    • Version-independent: ValueError
    • Integer: Number of Schemas for all Decimals in given Integer
    • Decimal: Number of Schemas at each version
  • get_activity_schema_paths()
    • Version-independent: ValueError
    • Integer: Number of Activity Schemas for all Decimals in given Integer
    • Decimal: Number of Activity Schemas at each version
  • get_organisation_schema_paths()
    • Version-independent: ValueError
    • Integer: Number of Org Schemas for all Decimals in given Integer
    • Decimal: Number of Org Schemas at each version

create_x_path() (see: #263)

  • create_codelist_path()
    • Codelist name that exists at all versions
      • All versions: A single path is returned
    • Codelist name that exists at some versions
      • All versions: A single path is returned
    • Codelist name that exists at no versions
      • All versions: A single path is returned
    • Non-str name: TypeError
    • Other version: ValueError
  • create_codelist_mapping_path()
    • Version-independent: ValueError
    • Integer: Most recent Decimal within the Integer
    • Decimal: There is a single mapping at each version
    • Other value: ValueError
  • create_lib_data_path()
    • Does not take a version argument
  • create_ruleset_path()
    • All versions: A single path is returned
    • All versions: Contains required components
  • create_schema_path()
    • All versions: A single path is returned
    • All versions: Contains required components

[folder|path]_for_x()

  • folder_name_for_version()
    • Expected output for each version
    • Version-independent: version-independent
    • Integer: [integer]
    • Decimal: [integer]-[decimal]
  • folder_name_for_version()
    • All versions: A single path is returned
    • All versions: Contains required components
  • path_for_version()
    • All versions: A single path is returned
    • All versions: Contains required components

pkg_resources fun

  • resource_filesystem_path()
    • All versions: A single path is returned
    • All versions: Contains required components

tests/resources.py

get_test_x()

  • get_test_data_path()
    • Don't need to test directly
  • get_test_data_paths_in_folder()
    • Number of files in a given folder
  • get_test_ruleset_path()
    • To remove

load_as_x()

  • load_as_dataset()
    • Ensure it returns a Dataset
  • load_as_string()
    • Ensure it returns a string

@hayfield hayfield added api Changes to the pyIATI API. incomplete A PR that is in a state that is not ready for review. standard-support Relating to how pyIATI supports a major component within the IATI Standard. labels Nov 28, 2017
@hayfield hayfield mentioned this pull request Nov 28, 2017
15 tasks
hayfield added a commit that referenced this pull request Dec 19, 2017
This is required for the completion of some things in #255
hayfield added a commit that referenced this pull request Dec 19, 2017
@hayfield hayfield added the versions Relating to IATI Version Numbers. label Feb 28, 2018
@hayfield
Copy link
Contributor Author

This PR is superseded by #297, so is being closed.

@hayfield hayfield closed this Mar 20, 2018
@hayfield hayfield deleted the 218ify-resource-version-arg branch March 20, 2018 14:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api Changes to the pyIATI API. incomplete A PR that is in a state that is not ready for review. standard-support Relating to how pyIATI supports a major component within the IATI Standard. versions Relating to IATI Version Numbers.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant