File tree Expand file tree Collapse file tree 5 files changed +16
-18
lines changed
Expand file tree Collapse file tree 5 files changed +16
-18
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44
55[project ]
66name = " planetarypy"
7- version = " 0.2.0 "
7+ version = " 0.2.1 "
88description = " Core package for planetary data tools. Includes PDS index utilities, SPICE integrations, and more."
99readme = " README.md"
1010requires-python = " >= 3.9, <4"
@@ -116,4 +116,4 @@ extend-ignore = ["E203", "E701"]
116116[tool .bumpversion ]
117117current_version = " 0.2.0"
118118commit = true
119- tag = true
119+ tag = true
Original file line number Diff line number Diff line change 22
33__author__ = """PlanetaryPy Developers"""
44__email__ = "kmichael.aye@gmail.com"
5- __version__ = "0.2.0 "
5+ __version__ = "0.2.1 "
Original file line number Diff line number Diff line change 77from .index_config import access_log , urls_config
88from .index_labels import IndexLabel
99from .indexes import Index
10- from .utils import (
11- get_index ,
12- list_indexes ,
13- list_instruments ,
14- list_missions ,
15- print_pds_tree ,
16- )
10+ from .utils import *
1711
1812__all__ = [
1913 "Index" ,
2317 "list_missions" ,
2418 "list_instruments" ,
2519 "list_indexes" ,
26- "print_pds_tree " ,
20+ "list_available_indexes " ,
2721 "get_index" ,
2822]
Original file line number Diff line number Diff line change @@ -132,7 +132,10 @@ def table_url(self):
132132
133133 @property
134134 def local_dir (self ):
135- p = storage_root / str (self .key ).replace ("." , "/" )
135+ # squeeze in an indexes subfolder
136+ key_path = Path (str (self .key ).replace ("." , "/" ))
137+ indexes_path = key_path .parent / Path ("indexes" ) / key_path .name
138+ p = storage_root / indexes_path
136139 p .mkdir (parents = True , exist_ok = True )
137140 return p
138141
Original file line number Diff line number Diff line change 77 "list_missions" ,
88 "list_instruments" ,
99 "list_indexes" ,
10- "print_pds_tree " ,
10+ "list_available_indexes " ,
1111 "get_index" ,
1212]
1313
1414from typing import Optional
1515
1616import pandas as pd
1717
18- from .indexes import Index
18+ from planetarypy . pds .indexes import Index
1919
2020
2121def list_missions () -> list [str ]:
@@ -116,7 +116,7 @@ def list_indexes(mission_instrument: str) -> list[str]:
116116 return sorted (indexes )
117117
118118
119- def print_pds_tree (
119+ def list_available_indexes (
120120 filter_mission : Optional [str ] = None , filter_instrument : Optional [str ] = None
121121) -> None :
122122 """Print an ASCII tree diagram of all missions, instruments, and indexes.
@@ -226,8 +226,9 @@ def get_index(
226226 >>> df = get_index('mro.ctx.edr')
227227 """
228228 index = Index (dotted_index_key )
229+ if not index .local_label_path .is_file ():
230+ index .download ()
229231 # only do time-consuming update check if refresh is True
230- if refresh :
231- if index .update_available :
232- index .download ()
232+ if (refresh and index .update_available ) or force :
233+ index .download ()
233234 return index .parquet
You can’t perform that action at this time.
0 commit comments