Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial implementation #1

Closed
godber opened this issue Jun 8, 2015 · 5 comments
Closed

Initial implementation #1

godber opened this issue Jun 8, 2015 · 5 comments
Assignees

Comments

@godber
Copy link
Member

godber commented Jun 8, 2015

The intent of this package is to provide a framework to systematically list and test as many planetary data types as possible. Not only should these products be enumerated, but their test values (e.g. label entries, pixel values) should also be stored in this module.

We have started a list of Missions, Instruments, products and our level of support here:

http://planetaryimage.readthedocs.org/en/latest/supported_planetary_image_types.html

I envision initial implementation of this package to be an extension of the get_test_data.py and data.json code I wrote for gdal_pds:

We would extend data.json to define additional keys to store expected test results and this file would be used as a source for acceptance testing for every mission product supported by PlanetaryPy. Ultimately it is impractical to include mission data in the main testsuite for the PlanetaryPy software, this module is intended to bridge that gap.

@godber
Copy link
Member Author

godber commented Jun 8, 2015

It might make sense to use (perhaps optionally) AstroPy's astropy.util.data modules:

http://astropy.readthedocs.org/en/latest/utils/#file-downloads

@godber
Copy link
Member Author

godber commented Jun 14, 2015

This comment contains and example JSON snippet for data driven tests planetarypy/planetaryimage#10 (comment)

@percurnicus
Copy link
Member

Start off by implementing the simplest data.json that contains a single Pancam product like:

{
    "1p190678905erp64kcp2600l8c1.img": {
        "url": "http://pds-geosciences.wustl.edu/mer/mer1-m-pancam-2-edr-sci-v1/mer1pc_0xxx/data/sol0704/1p190678905erp64kcp2600l8c1.img",
        "instrument": "Pancam",
        "opens": "True"
    },
}

Then write the downloader, get_mission_data.py that looks for the file at the relative path tests/mission_data/data.json. If it exists, use the existing file. If it doesn't exist, place the default data.json at that location, create the mission_data subdirectory if necessary. If tests/ exists, create the mission_data directory within it, if it does not exist, just create the mission_data directory in the present directory.

After the data.json file is in place, then load that json file and loop over the top level keys which should all be product names, test to see if the product already exists in the mission_data directory if it does, go onto the next one, if it does not then retrieve the file located at the url subkey and place it in the mission_data directory.

When including data.json make sure to use package_data, see:

@percurnicus
Copy link
Member

Follow the console_scripts example here:

You may use click to implement your CLI if you want, though it may not be necessary at this point since we are not taking any arguments or options yet.

@godber
Copy link
Member Author

godber commented Jul 9, 2015

Done! Looks great!

@godber godber closed this as completed Jul 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants