text
stringlengths
18
773k
def _to_http_hosts(hosts: Union[Iterable[str], str]) -> List[str]: """Convert a string of whitespace or comma separated hosts into a list of hosts. Hosts may also already be a list or other iterable. Each host will be prefixed with 'http://' if it is not already there. >>> _to_http_hosts('n1:4200,n2:4...
def _plain_or_callable(obj): """Returns the value of the called object of obj is a callable, otherwise the plain object. Returns None if obj is None. >>> obj = None >>> _plain_or_callable(obj) >>> stmt = 'select * from sys.nodes' >>> _plain_or_callable(stmt) 'select * from sys.nodes' ...
def _to_dsn(hosts): """Convert a host URI into a dsn for aiopg. >>> _to_dsn('aiopg://myhostname:4242/mydb') 'postgres://crate@myhostname:4242/mydb' >>> _to_dsn('aiopg://myhostname:4242') 'postgres://crate@myhostname:4242/doc' >>> _to_dsn('aiopg://hoschi:pw@myhostname:4242/doc?sslmode=require'...
def _verify_ssl_from_first(hosts): """Check if SSL validation parameter is passed in URI >>> _verify_ssl_from_first(['https://myhost:4200/?verify_ssl=false']) False >>> _verify_ssl_from_first(['https://myhost:4200/']) True >>> _verify_ssl_from_first([ ... 'https://h1:4200/?verify_ssl...
def addTable(D): """ Add any table type to the given dataset. Use prompts to determine index locations and table type. :param dict D: Metadata (dataset) :param dict dat: Metadata (table) :return dict D: Metadata (dataset) """ _swap = { "1": "measurement", "2": "summary", ...
def _get_available_placements(D, tt): """ Called from: _prompt_placement() Get a list of possible places that we can put the new model data into. If no model exists yet, we'll use something like chron0model0. If other models exist, we'll go for the n+1 entry. ex: chron0model0 already exists, so...
def _prompt_placement(D, tt): """ Since automatic placement didn't work, find somewhere to place the model data manually with the help of the user. :param dict D: Metadata :param str tt: Table type :return str _model_name: Chosen model name for placement """ _model_name = "" # There was...
def _put_table(D, name, table): """ Use the dataset and name to place the new table data into the dataset. :param dict D: Dataset :param str name: Table name / path to store new table :param dict table: Newly created table data :return dict D: Dataset """ try: # print("Placing ...
def _update_table_names(name, dat): """ Model placement is subject to change. That means all names within the model (names are path-dependent) are also subject to change. Whichever name is decided, the inner data needs to match it. :param dict dat: Metadata :param str name: Table name :return d...
def addModel(D, models): """ Insert model data into a LiPD dataset Examples of model naming: chron0model0 chron0model1 chron1model0 Example of 'models' variable: { chron0model0: { "method": {...}, "summaryTable": [...], ...
def _put_model(D, name, dat, m): """ Place the model data given, into the location (m) given. :param dict D: Metadata (dataset) :param str name: Model name (ex: chron0model0) :param dict dat: Model data :param regex m: Model name regex groups :return dict D: Metadata (dataset) """ t...
def prepare_env(app, env, docname): """ Prepares the sphinx environment to store sphinx-needs internal data. """ if not hasattr(env, 'needs_all_needs'): # Used to store all needed information about all needs in document env.needs_all_needs = {} if not hasattr(env, 'needs_functions')...
def make_entity_name(name): """Creates a valid PlantUML entity name from the given value.""" invalid_chars = "-=!#$%^&*[](){}/~'`<>:;" for char in invalid_chars: name = name.replace(char, "_") return name
def main(self): """ Load in the template file, and run through the parser :return none: """ logger_lpd_noaa.info("enter main") # Starting Directory: dir_tmp/dir_bag/data/ # convert all lipd keys to noaa keys # timestamp the conversion of the file ...
def __check_time_values(self): """ Rules 1. AD or CE units: bigger number is recent, smaller number is older 2. BP: bigger number is older, smaller number is recent. 3. No units: If max year is 1900-2017(current), then assume AD. Else, assume BP :return none: """...
def __convert_keys_2(header, d): """ Convert lpd to noaa keys for this one section :param str header: Section header :param dict d: Metadata :return dict: Metadata w/ converted keys """ d_out = {} try: for k, v in d.items(): tr...
def __convert_keys_1(self, header, d): """ Loop over keys in a dictionary and replace the lipd keys with noaa keys :return: """ d2 = {} try: for k, v in d.items(): try: d2[self.__get_noaa_key_w_context(header, k)] = v ...
def __create_blanks(section_name, d): """ All keys need to be written to the output, with or without a value. Furthermore, only keys that have values exist at this point. We need to manually insert the other keys with a blank value. Loop through the global list to see what's missing in o...
def __flatten_col(d): """ Flatten column so climateInterpretation and calibration are not nested. :param d: :return: """ try: for entry in ["climateInterpretation", "calibration"]: if entry in d: for k, v in d[entry].items(...
def __generate_study_name(self): """ When a study name is not given, generate one with the format of " author - site name - year " :return str study_name: generated study name """ study_name = "" _exist = False try: if self.noaa_data_sorted["Top"]["Stu...
def __lists_to_str(self): """ There are some data lists that we collected across the dataset that need to be concatenated into a single string before writing to the text file. :return none: """ # ["archive_type", "sensor_genus", "sensor_species", "investigator"] i...
def __parse_dois(self, x): """ Parse the Dataset_DOI field. Could be one DOI string, or a list of DOIs :param any x: Str or List of DOI ids :return none: list is set to self """ # datasetDOI is a string. parse, validate and return a list of DOIs if isinstance(x, s...
def __split_path(string): """ Used in the path_context function. Split the full path into a list of steps :param str string: Path string ("geo-elevation-height") :return list out: Path as a list of strings. One entry per path step.(["geo", "elevation", "height"]) """ out ...
def _values_exist(table): """ Check that values exist in this table, and we can write out data columns :param dict table: Table data :return bool: Values exist or not exist """ try: for var, data in table["columns"].items(): if "values" in data...
def __reorganize(self): """ Reorganize the keys into their proper section order for the NOAA output file DO NOT parse data tables (paleoData or chronData). We will do those separately. :param str key: :param any value: :return none: """ logger_lpd_noaa.inf...
def __reorganize_author(self): """ LiPD delimits author names by "and". Noaa wants them to be semi-colon delimited. :return none: """ try: for idx, pub in enumerate(self.noaa_data_sorted["Publication"]): if "author" in pub: _str = p...
def __reorganize_coordinates(self): """ GEOJSON FORMAT : [ LONGITUDE, LATITUDE, ELEVATION] Reorganize coordinates based on how many values are available. :return: """ try: l = self.noaa_data_sorted["Site_Information"]['geometry']['coordinates'] lo...
def __reorganize_funding(self): """ Funding gets added to noaa_data_sorted with LiPD keys. Change those keys to NOAA :return none: """ _map = {"agency": "Funding_Agency_Name", "grant": "Grant"} try: _l = [] for item in self.noaa_data_sorted["Fundin...
def __reorganize_geo(self): """ Concat geo value and units, and reorganize the rest References geo data from self.noaa_data_sorted Places new data into self.noaa_geo temporarily, and then back into self.noaa_data_sorted. :return: """ logger_lpd_noaa.info("enter re...
def __reorganize_sensor(self): """ We have raw sensorGenus, and sensorSpecies in self, now clean and sort :return none: """ _code = [] _name = [] # Check if any of the sensor data is misplaced, and create corrected lists. if self.lsts_tmp["genus"]: ...
def __put_names_on_csv_cols(names, cols): """ Put the variableNames with the corresponding column data. :param list names: variableNames :param list cols: List of Lists of column data :return dict: """ _combined = {} for idx, name in enumerate(names): ...
def __put_year_col_first(d): """ Always write year column first. Reorder dictionary so that year is first :param dict d: data :return dict: Reordered data """ if "year" in d: D = OrderedDict() # store the year column first D["year"] = d...
def __rm_duplicate_citation_2(self, key): """ Remove exact duplicate entries for abstract or citation fields. Check all publication entries. :return: """ citations = [] # Before writing, remove any duplicate "Full_Citations" that are found for idx, pub in enumerat...
def __rm_names_on_csv_cols(d): """ Remove the variableNames from the columns. :param dict d: Named csv data :return list list: One list for names, one list for column data """ _names = [] _data = [] for name, data in d.items(): _names.append(na...
def __get_author_last_name(author): """ Take a string of author(s), get the first author name, then get the first authors last name only. :param str author: Author(s) :return str _author: First author's last name """ _author = "" if isinstance(author, str): ...
def __create_author_investigator_str(self): """ When investigators is empty, try to get authors from the first publication instead. :return str author: Author names """ _author = "" try: for pub in self.noaa_data_sorted["Publication"]: if "auth...
def __get_filename(table): """ Get filename from a data table :param dict table: :return str: """ try: filename = table['filename'] except KeyError as e: filename = "" logger_lpd_noaa.warning("get_filename: KeyError: Table missi...
def __get_doi(pub): """ Get DOI from this ONE publication entry. :param dict pub: Single publication entry :return: """ doi = "" # Doi location: d["pub"][idx]["identifier"][0]["id"] try: doi = pub["DOI"][0]["id"] doi = clean_doi(doi...
def __get_noaa_key_w_context(header, lipd_key): """ Use the section header and key to get the proper noaa key. :param str header: :param str lipd_key: :return: """ try: noaa_key = LIPD_NOAA_MAP_BY_SECTION[header][lipd_key] except KeyError: ...
def __get_overall_data(self, x): """ (recursive) Collect all "sensorGenus" and "sensorSpecies" fields, set data to self :param any x: Any data type :return none: """ if isinstance(x, dict): if "sensorGenus" in x: if x["sensorGenus"] and x["sens...
def __get_max_min_time_1(self, table): """ Search for either Age or Year to calculate the max, min, and time unit for this table/file. Preference: Look for Age first, and then Year second (if needed) :param dict table: Table data :return dict: Max, min, and time unit """...
def __get_max_min_time_2(table, terms, exact): """ Search for either Age or Year to calculate the max, min, and time unit for this table/file. Preference: Look for Age first, and then Year second (if needed) :param dict table: Table data :param list terms: age, yearbp, yrbp, or ...
def __get_data_citation(self, l): """ If originalDataURL / investigators not in root data, check for a dataCitation pub entry. :return: """ # loop once for each publication entry for pub in l: try: # at the moment, these are the only keys of in...
def __get_output_filenames(self): """ Set up the output filenames. If more than one file is being written out, we need appended filenames. :return: """ # if there is only one file, use the normal filename with nothing appended. if len(self.noaa_data_sorted["Data"]) == 1: ...
def __get_table_pairs(self): """ Use the tables in self.paleos and self.chrons (sorted by idx) to put in self.noaa_data_sorted. :return: """ try: for _idx, _p in enumerate(self.data_paleos): _c = {} try: _c = self.da...
def __get_table_count(self): """ Check how many tables are in the json :return int: """ _count = 0 try: keys = ["paleo", "paleoData", "paleoMeasurementTable"] # get the count for how many tables we have. so we know to make appended filenames or not...
def __put_tables_in_self(self, keys): """ Metadata is sorted-by-name. Use this to put the table data into the object self. :param list keys: Paleo or Chron keys :return none: """ _idx = 1 try: # start adding the filenames to the JSON and adding the tab...
def __create_file(self): """ Open text file. Write one section at a time. Close text file. Move completed file to dir_root/noaa/ :return none: """ logger_lpd_noaa.info("enter create_file") self.__get_output_filenames() for idx, filename in enumerate(self.output_...
def __write_top(self, filename_txt): """ Write the top section of the txt file. :param int section_num: Section number :return none: """ logger_lpd_noaa.info("writing section: {}".format("top")) self.__create_blanks("Top", self.noaa_data_sorted["Top"]) # ...
def __write_generic(self, header, d=None): """ Write a generic section to the .txt. This function is reused for multiple sections. :param str header: Header title for this section :param int section_num: :param dict d: Section from steps_dict :return none: """ ...
def __write_pub(self): """ Write pub section. There may be multiple, so write a generic section for each one. :return none: """ try: self.__reorganize_author() # Check all publications, and remove possible duplicate Full_Citations self.__rm_dup...
def __write_funding(self): """ Write funding section. There are likely multiple entries. :param dict d: :return none: """ self.__reorganize_funding() # if funding is empty, insert a blank entry so that it'll still write the empty section on the template. i...
def __write_data(self, idx): """ Write out the measurement tables found in paleoData and chronData :return: """ pair = self.noaa_data_sorted["Data"][idx] # Run once for each pair (paleo+chron) of tables that was gathered earlier. # for idx, pair in enumerate(self....
def __write_variables_1(self, table): """ Retrieve variables from data table(s) and write to Variables section of txt file. :param dict table: Paleodata :return none: """ logger_lpd_noaa.info("writing section: {}".format("Variables")) # Write the template lines f...
def __write_variables_2(self, col): """ Use one column of data, to write one line of data in the variables section. :return none: """ col = self.__convert_keys_1("Variables", col) # Write one line for each column. One line has all metadata for one column. for ent...
def __write_columns(self, pc, table): """ Read numeric data from csv and write to the bottom section of the txt file. :param dict table: Paleodata dictionary :return none: """ logger_lpd_noaa.info("writing section: data, csv values from file") # get filename for t...
def __write_k_v(self, k, v, top=False, bot=False, multi=False, indent=False): """ Write a key value pair to the output file. If v is a list, write multiple lines. :param k: Key :param v: Value :param bool top: Write preceding empty line :param bool bot: Write following em...
def __write_divider(self, top=False, bot=False, nl=True): """ Write a divider line :return none: """ if top: self.noaa_txt += "\n#" if nl: self.noaa_txt += "\n" self.noaa_txt += "#------------------\n" if bot: self.noaa_...
def __write_data_col_header(self, l, pc): """ Write the variableNames that are the column header in the "Data" section :param list l: variableNames :return none: """ count = len(l) if pc == "chron": self.noaa_txt += "# " for name in l: ...
def __write_data_col_vals(self, ll, pc): """ Loop over value arrays and write index by index, to correspond to the rows of a txt file :param list ll: List of lists, column data :return: """ # all columns should have the same amount of values. grab that number try...
def copy(app, need, needs, option, need_id=None): """ Copies the value of one need option to another .. code-block:: jinja .. req:: copy-example :id: copy_1 :tags: tag_1, tag_2, tag_3 :status: open .. spec:: copy-example implementation :id: copy...
def check_linked_values(app, need, needs, result, search_option, search_value, filter_string=None, one_hit=False): """ Returns a specific value, if for all linked needs a given option has a given value. The linked needs can be filtered by using the ``filter`` option. If ``one_hit`` is set to True, onl...
def calc_sum(app, need, needs, option, filter=None, links_only=False): """ Sums the values of a given option in filtered needs up to single number. Useful e.g. for calculating the amount of needed hours for implementation of all linked specification needs. **Input data** .. spec:: Do this ...
def noaa_prompt(): """ Convert between NOAA and LiPD file formats. :return: """ logger_noaa.info("enter noaa") # Run lpd_noaa or noaa_lpd ? print("Which conversion?\n1. LPD to NOAA\n2. NOAA to LPD\n") mode = input("Option: ") logger_noaa.info("chose option: {}".format(mode)) ret...
def noaa_prompt_1(): """ For converting LiPD files to NOAA, we need a couple more pieces of information to create the WDS links :return str _project: Project name :return float _version: Version number """ print("Enter the project information below. We'll use this to create the WDS URL") pr...
def noaa_to_lpd(files): """ Convert NOAA format to LiPD format :param dict files: Files metadata :return None: """ logger_noaa.info("enter process_noaa") # only continue if the user selected a mode correctly logger_noaa.info("Found {} NOAA txt file(s)".format(str(len(files[".txt"])))) ...
def lpd_to_noaa(D, wds_url, lpd_url, version, path=""): """ Convert a LiPD format to NOAA format :param dict D: Metadata :return dict D: Metadata """ logger_noaa.info("enter process_lpd") d = D try: dsn = get_dsn(D) # Remove all the characters that are not allowed here. ...
def __write_noaas(dat, path): """ Use the filename - text data pairs to write the data as NOAA text files :param dict dat: NOAA data to be written :return none: """ for filename, text in dat.items(): try: with open(os.path.join(path, filename), "w+") as f: f....
def _parse_java_version(line: str) -> tuple: """ Return the version number found in the first line of `java -version` >>> _parse_java_version('openjdk version "11.0.2" 2018-10-16') (11, 0, 2) """ m = VERSION_RE.search(line) version_str = m and m.group(0).replace('"', '') or '0.0.0' if '_' i...
def find_java_home(cratedb_version: tuple) -> str: """ Return a path to a JAVA_HOME suites for the given CrateDB version """ if MIN_VERSION_FOR_JVM11 <= cratedb_version < (4, 0): # Supports 8 to 11+, use whatever is set return os.environ.get('JAVA_HOME', '') if cratedb_version < MIN_VERSION_...
def zipper(root_dir="", name="", path_name_ext=""): """ Zips up directory back to the original location :param str root_dir: Root directory of the archive :param str name: <datasetname>.lpd :param str path_name_ext: /path/to/filename.lpd """ logger_zips.info("re_zip: name: {}, dir_tmp: {}".f...
def unzipper(filename, dir_tmp): """ Unzip .lpd file contents to tmp directory. :param str filename: filename.lpd :param str dir_tmp: Tmp folder to extract contents to :return None: """ logger_zips.info("enter unzip") # Unzip contents to the tmp directory try: with zipfile.Zi...
def percentile(sorted_values, p): """Calculate the percentile using the nearest rank method. >>> percentile([15, 20, 35, 40, 50], 50) 35 >>> percentile([15, 20, 35, 40, 50], 40) 20 >>> percentile([], 90) Traceback (most recent call last): ... ValueError: Too few data points (0...
def get_sampler(sample_mode: str): """Return a sampler constructor >>> get_sampler('all') <class 'cr8.metrics.All'> >>> get_sampler('reservoir') <class 'cr8.metrics.UniformReservoir'> >>> get_sampler('reservoir:100') functools.partial(<class 'cr8.metrics.UniformReservoir'>, size=100) ...
def query(self, criteria, **opts): """ Returns a dict of the query, including the results :param critera: string of search criteria :param **opts: :formats: json/xml (default: json) :timezone: timezone to use (default: UTC) :time_from: 15m ...
def excel_main(file): """ Parse data from Excel spreadsheets into LiPD files. :param dict file: File metadata (source, name, etc) :return str dsn: Dataset name """ os.chdir(file["dir"]) name_ext = file["filename_ext"] # Filename without extension name = file["filename_no_ext"] ...
def _get_sheet_metadata(workbook, name): """ Get worksheet metadata. The sheet names tell us what type of table it is and where in the LiPD structure the data should be placed. Example VALID sheet name: paleo1measurement1 paleo1model1ensemble1 paleo1model1distribution1 Example INVALID ...
def _sheet_meta_from_prompts(sheets, old_name, name, ct_paleo, ct_chron): """ Guide the user to create a proper, standardized sheet name :param list sheets: Running list of sheet metadata :param str old_name: Original sheet name :param str name: Data set name :param int ct_paleo: Running count o...
def _sheet_meta_from_regex(m, sheets, old_name, name, ct_paleo, ct_chron): """ Build metadata for a sheet. Receive valid regex match object and use that to create metadata. :param obj m: Regex match object :param list sheets: Running list of sheet metadata :param str old_name: Original sheet name ...
def _place_tables_section(skeleton_section, sheet, keys_section): """ Place data into skeleton for either a paleo or chron section. :param dict skeleton_section: Empty or current progress of skeleton w/ data :param dict sheet: Sheet metadata :param list keys_section: Paleo or Chron specific keys ...
def _place_tables_main(sheets, skeleton_paleo, skeleton_chron): """ All the data has been parsed, skeletons have been created, now put the data into the skeletons. :param list sheets: All metadata needed to place sheet data into the LiPD structure :param list skeleton_paleo: The empty skeleton where we ...
def _get_table_counts(sheet, num_section): """ Loop through sheet metadata and count how many of each table type is needed at each index. Example: 'paleo 1' needs {'2 measurement tables', '1 model table, with 1 summary, 1 ensemble, and 3 distributions'} :param dict sheet: Sheet metadata :param dict ...
def _create_skeleton_3(pc, l, num_section): """ Bottom level: {"measurement": [], "model": [{summary, distributions, ensemble}]} Fill in measurement and model tables with N number of EMPTY meas, summary, ensemble, and distributions. :param str pc: Paleo or Chron "mode" :param list l: :param dict...
def _create_skeleton_2(l, pc, num_section, template): """ Mid level: {"measurement", "model"} Fill in paleoData tables with N number of EMPTY measurement and models. :param list l: paleoData or chronData list of tables :param dict num_section: Number of tables needed for each table type :param ...
def _create_skeleton_1(sheets): """ Top level: {"chronData", "paleoData"} Fill in paleoData/chronData tables with N number of EMPTY measurement and models. :return list: Blank list of N indices """ logger_excel.info("enter create_skeleton_main") # Table template: paleoData template_pal...
def _parse_sheet(workbook, sheet): """ The universal spreadsheet parser. Parse chron or paleo tables of type ensemble/model/summary. :param str name: Filename :param obj workbook: Excel Workbook :param dict sheet: Sheet path and naming info :return dict dict: Table metadata and numeric data ...
def _parse_sheet_data_row(temp_sheet, num_row, col_total, table_data, filename, mv): """ Parse a row from the data section of the sheet. Add the cleaned row data to the overall table data. :param obj temp_sheet: Excel sheet :param int num_row: Current sheet row :param int col_total: Number of column...
def _replace_mvs(row, mv): """ Replace Missing Values in the data rows where applicable :param list row: Row :return list: Modified row """ for idx, v in enumerate(row): try: if v.value.lower() in EMPTY or v.value.lower() == mv: row[idx] = "nan" el...
def _get_header_keys(row): """ Get the variable header keys from this special row :return list: Header keys """ # Swap out NOAA keys for LiPD keys for idx, key in enumerate(row): key_low = key.value.lower() # Simple case: Nothing fancy here, just map to the LiPD key counterpart....
def _rm_units_from_var_name_single(var): """ NOTE: USE THIS FOR SINGLE CELLS ONLY When parsing sheets, all variable names be exact matches when cross-referenceing the metadata and data sections However, sometimes people like to put "age (years BP)" in one section, and "age" in the other. This causes pro...
def _rm_units_from_var_names_multi(row): """ Wrapper around "_rm_units_from_var_name_single" for doing a list instead of a single cell. :param list row: Variable names :return list: Variable names """ l2 = [] # Check each var in the row for idx, var in enumerate(row): l2.append(_...
def _compile_interpretation(data): """ Compile the interpretation data into a list of multiples, based on the keys provided. Disassemble the key to figure out how to place the data :param dict data: Interpretation data (unsorted) :return dict: Interpretation data (sorted) """ # KEY FORMAT : ...
def _compile_column_metadata(row, keys, number): """ Compile column metadata from one excel row ("9 part data") :param list row: Row of cells :param list keys: Variable header keys :return dict: Column metadata """ # Store the variable keys by index in a dictionary _column = {} _inte...
def _rm_cells_reverse(l): """ Remove the cells that are empty or template in reverse order. Stop when you hit data. :param list l: One row from the spreadsheet :return list: Modified row """ rm = [] # Iter the list in reverse, and get rid of empty and template cells for idx, key in rever...
def _write_data_csv(csv_data): """ CSV data has been parsed by this point, so take it and write it file by file. :return: """ logger_excel.info("enter write_data_csv") # Loop for each file and data that is stored for file in csv_data: for filename, data in file.items(): #...
def geometry_linestring(lat, lon, elev): """ GeoJSON Linestring. Latitude and Longitude have 2 values each. :param list lat: Latitude values :param list lon: Longitude values :return dict: """ logger_excel.info("enter geometry_linestring") d = OrderedDict() coordinates = [] temp...
def geometry_range(crd_range, elev, crd_type): """ Range of coordinates. (e.g. 2 latitude coordinates, and 0 longitude coordinates) :param crd_range: Latitude or Longitude values :param elev: Elevation value :param crd_type: Coordinate type, lat or lon :return dict: """ d = OrderedDict(...
def geometry_point(lat, lon, elev): """ GeoJSON point. Latitude and Longitude only have one value each :param list lat: Latitude values :param list lon: Longitude values :param float elev: Elevation value :return dict: """ logger_excel.info("enter geometry_point") coordinates = [] ...
def compile_geometry(lat, lon, elev): """ Take in lists of lat and lon coordinates, and determine what geometry to create :param list lat: Latitude values :param list lon: Longitude values :param float elev: Elevation value :return dict: """ logger_excel.info("enter compile_geometry") ...
def compile_geo(d): """ Compile top-level Geography dictionary. :param d: :return: """ logger_excel.info("enter compile_geo") d2 = OrderedDict() # get max number of sites, or number of coordinate points given. num_loc = _get_num_locations(d) # if there's one more than one locat...