Mercurial > repos > iuc > data_manager_pangolearn
changeset 1:112bb7a9da3c draft
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_pangolearn commit 1f7b91c7bbd72d30ab47c64d0796ce9825edcaf9"
author | iuc |
---|---|
date | Wed, 02 Jun 2021 16:06:25 +0000 |
parents | 3eac657893fe |
children | ed7a967cb11b |
files | data_manager/pangolearn_dm.py data_manager/pangolearn_dm.xml test-data/pangolearn.loc |
diffstat | 3 files changed, 26 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/data_manager/pangolearn_dm.py Sat Apr 24 20:56:04 2021 +0000 +++ b/data_manager/pangolearn_dm.py Wed Jun 02 16:06:25 2021 +0000 @@ -93,7 +93,7 @@ parser.add_argument("--start_date", type=parse_date) parser.add_argument("--end_date", type=parse_date) parser.add_argument("--overwrite", default=False, action="store_true") - parser.add_argument('--pangolearn_format_version', default="1.0") + parser.add_argument('--pangolearn_format_version') parser.add_argument("datatable_name") parser.add_argument("galaxy_datamanager_filename") args = parser.parse_args() @@ -139,11 +139,20 @@ ] for release in releases_to_download: tag = download_and_unpack(release["tarball_url"], output_directory) + release_date = parse_date(tag) + if args.pangolearn_format_version is not None: + version = args.pangolearn_format_version + else: + # 2021-05-27 was the first release of pangoLEARN for pangolin 3, which changed DB format + if release_date >= datetime.datetime(2021, 5, 27): + version = '3.0' + else: + version = '1.0' data_manager_dict["data_tables"][args.datatable_name].append( dict( value=tag, description=release["name"], - format_version=args.pangolearn_format_version, + format_version=version, path=output_directory + "/" + tag, ) )
--- a/data_manager/pangolearn_dm.xml Sat Apr 24 20:56:04 2021 +0000 +++ b/data_manager/pangolearn_dm.xml Wed Jun 02 16:06:25 2021 +0000 @@ -50,9 +50,22 @@ <output name="output_file"> <assert_contents> <has_text text="pangoLEARN data release 2021-04-01"/> + <has_text text='"format_version": "1.0"'/> </assert_contents> </output> </test> + <test> + <conditional name="release"> + <param name="which" value="date_range" /> + <param name="start_date" value="2021-05-27" /> + <param name="end_date" value="2021-05-27" /> + </conditional> + <output name="output_file"> + <assert_contents> + <has_text text='"format_version": "3.0"'/> + </assert_contents> + </output> + </test> </tests> <help><![CDATA[ This data managers fetches models (from the pangoLEARN_ repository) for the pangolin_
--- a/test-data/pangolearn.loc Sat Apr 24 20:56:04 2021 +0000 +++ b/test-data/pangolearn.loc Wed Jun 02 16:06:25 2021 +0000 @@ -5,4 +5,5 @@ # value description format_version path # # for example -# 2021-04-14 pangoLEARN data release 2021-04-14 1.0 /tmp/database/pangolearn/pangolearn/2021-04-14 +# 2021-04-14 pangoLEARN data release 2021-04-14 1.0 /tmp/database/pangolearn/2021-04-14 +# 2021-05-27 pangoLEARN data release 2021-05-27 3.0 /tmp/database/pangolearn/2021-05-27