text stringlengths 81 112k |
|---|
Calculate Resolution and m/m/m/m for column values.
:param dict column: Column data
:param list age: Age values
:return dict column: Column data - modified
def _get_inferred_data_res(column, age):
"""
Calculate Resolution and m/m/m/m for column values.
:param dict column: Column data
:param... |
Calculate the m/m/m/m for column values.
:param dict column: Column data
:return dict column: Column data - modified
def _get_inferred_data_column(column):
"""
Calculate the m/m/m/m for column values.
:param dict column: Column data
:return dict column: Column data - modified
"""
try:
... |
Table level: Dive down, calculate data, then return the new table with the inferred data.
:param str pc: paleo or chron
:param dict table: Metadata
:return dict table: Metadata
def get_inferred_data_table(table, pc):
"""
Table level: Dive down, calculate data, then return the new table with the in... |
Registers a new sphinx-needs function for the given sphinx environment.
:param env: Sphinx environment
:param need_function: Python method
:return: None
def register_func(env, need_function):
"""
Registers a new sphinx-needs function for the given sphinx environment.
:param env: Sphinx environm... |
Executes a given function string.
:param env: Sphinx environment
:param need: Actual need, which contains the found function string
:param func_string: string of the found function. Without [[ ]]
:return: return value of executed function
def execute_func(env, need, func_string):
"""
Executes a... |
Search inside a given node and its children for nodes of type Text,
if found check if it contains a function string and run/replace it.
:param node: Node to analyse
:return: None
def find_and_replace_node_content(node, env, need):
"""
Search inside a given node and its children for nodes of type T... |
Resolve dynamic values inside need data.
Rough workflow:
#. Parse all needs and their data for a string like [[ my_func(a,b,c) ]]
#. Extract function name and call parameters
#. Execute registered function name with extracted call parameters
#. Replace original string with return value
:param... |
Analyze given functiion string an extract:
* function name
* function arguments
* function keyword arguments
All given arguments must by of type string, int/float or list.
:param func_string: string of the function
:return: function name, arguments, keyword arguments
def _analyze_func_string... |
Initialize and start objects. This is called automatically when importing the package.
:return none:
def run():
"""
Initialize and start objects. This is called automatically when importing the package.
:return none:
"""
# GLOBALS
global cwd, files, logger_start, logger_benchmark, setting... |
Read LiPD file(s).
Enter a file path, directory path, or leave args blank to trigger gui.
:param str usr_path: Path to file / directory (optional)
:return dict _d: Metadata
def readLipd(usr_path=""):
"""
Read LiPD file(s).
Enter a file path, directory path, or leave args blank to trigger gui.
... |
Read Excel file(s)
Enter a file path, directory path, or leave args blank to trigger gui.
:param str usr_path: Path to file / directory (optional)
:return str cwd: Current working directory
def readExcel(usr_path=""):
"""
Read Excel file(s)
Enter a file path, directory path, or leave args blan... |
Convert Excel files to LiPD files. LiPD data is returned directly from this function.
| Example
| 1: lipd.readExcel()
| 2: D = lipd.excel()
:return dict _d: Metadata
def excel():
"""
Convert Excel files to LiPD files. LiPD data is returned directly from this function.
| Example
| 1: ... |
Convert between NOAA and LiPD files
| Example: LiPD to NOAA converter
| 1: L = lipd.readLipd()
| 2: lipd.noaa(L, "/Users/someuser/Desktop", "https://www1.ncdc.noaa.gov/pub/data/paleo/pages2k/NAm2kHydro-2017/noaa-templates/data-version-1.0.0", "https://www1.ncdc.noaa.gov/pub/data/paleo/pages2k/NAm2kHydro-20... |
Use the Validator API for lipd.net to validate all LiPD files in the LiPD Library.
Display the PASS/FAIL results. Display detailed results if the option is chosen.
:param dict D: Metadata (single or multiple datasets)
:param bool detailed: Show or hide the detailed results of each LiPD file. Shows warnings... |
Create Pandas DataFrame from TimeSeries object.
Use: Must first extractTs to get a time series. Then pick one item from time series and pass it through
:param dict tso: Time series entry
:return dict dfs: Pandas dataframes
def tsToDf(tso):
"""
Create Pandas DataFrame from TimeSeries object.
Us... |
Create a time series using LiPD data (uses paleoData by default)
| Example : (default) paleoData and meas tables
| 1. D = lipd.readLipd()
| 2. ts = lipd.extractTs(D)
| Example : chronData and all tables
| 1. D = lipd.readLipd()
| 2. ts = lipd.extractTs(D, "all", "chron")
:param dict d: Me... |
Collapse a time series back into LiPD record form.
| Example
| 1. D = lipd.readLipd()
| 2. ts = lipd.extractTs(D)
| 3. New_D = lipd.collapseTs(ts)
_timeseries_data is sorted by time_id, and then by dataSetName
_timeseries_data[10103341]["ODP1098B"] = {data}
:param list ts: Time series
... |
Create a new time series that only contains entries that match the given expression.
| Example:
| D = lipd.loadLipd()
| ts = lipd.extractTs(D)
| new_ts = filterTs(ts, "archiveType == marine sediment")
| new_ts = filterTs(ts, ["paleoData_variableName == sst", "archiveType == marine sediment"])
|... |
Find the indices of the time series entries that match the given expression.
| Example:
| D = lipd.loadLipd()
| ts = lipd.extractTs(D)
| matches = queryTs(ts, "archiveType == marine sediment")
| matches = queryTs(ts, "geo_meanElev <= 2000")
:param str expression: Expression
:param list ts:... |
View the contents of one time series entry in a nicely formatted way
| Example
| 1. D = lipd.readLipd()
| 2. ts = lipd.extractTs(D)
| 3. viewTs(ts[0])
:param dict ts: One time series entry
:return none:
def viewTs(ts):
"""
View the contents of one time series entry in a nicely formatt... |
Display the dataset names of a given LiPD data
| Example
| lipd.showLipds(D)
:pararm dict D: LiPD data
:return none:
def showLipds(D=None):
"""
Display the dataset names of a given LiPD data
| Example
| lipd.showLipds(D)
:pararm dict D: LiPD data
:return none:
"""
i... |
Display the metadata specified LiPD in pretty print
| Example
| showMetadata(D["Africa-ColdAirCave.Sundqvist.2013"])
:param dict dat: Metadata
:return none:
def showMetadata(dat):
"""
Display the metadata specified LiPD in pretty print
| Example
| showMetadata(D["Africa-ColdAirCave.S... |
Display the available data frame names in a given data frame collection
:param dict d: Dataframe collection
:return none:
def showDfs(d):
"""
Display the available data frame names in a given data frame collection
:param dict d: Dataframe collection
:return none:
"""
if "metadata" in ... |
Get a list of all LiPD names in the library
| Example
| names = lipd.getLipdNames(D)
:return list f_list: File list
def getLipdNames(D=None):
"""
Get a list of all LiPD names in the library
| Example
| names = lipd.getLipdNames(D)
:return list f_list: File list
"""
_names = ... |
Get metadata from a LiPD data in memory
| Example
| m = lipd.getMetadata(D["Africa-ColdAirCave.Sundqvist.2013"])
:param dict L: One LiPD record
:return dict d: LiPD record (metadata only)
def getMetadata(L):
"""
Get metadata from a LiPD data in memory
| Example
| m = lipd.getMetadata... |
Get CSV from LiPD metadata
| Example
| c = lipd.getCsv(D["Africa-ColdAirCave.Sundqvist.2013"])
:param dict L: One LiPD record
:return dict d: CSV data
def getCsv(L=None):
"""
Get CSV from LiPD metadata
| Example
| c = lipd.getCsv(D["Africa-ColdAirCave.Sundqvist.2013"])
:param di... |
Write LiPD data to file(s)
:param dict dat: Metadata
:param str path: Destination (optional)
:return none:
def writeLipd(dat, path=""):
"""
Write LiPD data to file(s)
:param dict dat: Metadata
:param str path: Destination (optional)
:return none:
"""
global settings
start ... |
Use a file path to create file metadata and load a file in the appropriate way, according to the provided file type.
:param str file_path: Path to file
:param str file_type: One of approved file types: xls, xlsx, txt, lpd
:return none:
def __universal_read(file_path, file_type):
"""
Use a file pat... |
Determine what path needs to be taken to read in file(s)
:param str usr_path: Path (optional)
:param str file_type: File type to read
:return none:
def __read(usr_path, file_type):
"""
Determine what path needs to be taken to read in file(s)
:param str usr_path: Path (optional)
:param s... |
Use the file metadata to read in the LiPD file contents as a dataset library
:return dict: Metadata
def __read_lipd_contents():
"""
Use the file metadata to read in the LiPD file contents as a dataset library
:return dict: Metadata
"""
global files, settings
_d = {}
try:
if le... |
Universal read file. Given a path and a type, it will do the appropriate read actions
:param str usr_path: Path to file
:param str file_type: One of approved file types: xls, xlsx, txt, lpd
:return none:
def __read_file(usr_path, file_type):
"""
Universal read file. Given a path and a type, it wil... |
Universal read directory. Given a path and a type, it will do the appropriate read actions
:param str usr_path: Path to directory
:param str file_type: .xls, .xlsx, .txt, .lpd
:return none:
def __read_directory(usr_path, file_type):
"""
Universal read directory. Given a path and a type, it will do... |
Write LiPD data to file, provided an output directory and dataset name.
:param dict dat: Metadata
:param str usr_path: Destination path
:param str dsn: Dataset name of one specific file to write
:return none:
def __write_lipd(dat, usr_path):
"""
Write LiPD data to file, provided an output dire... |
Print the disclaimers once. If they've already been shown, skip over.
:return none:
def __disclaimer(opt=""):
"""
Print the disclaimers once. If they've already been shown, skip over.
:return none:
"""
global settings
if opt is "update":
print("Disclaimer: LiPD files may be update... |
Adds files to builder resources only, if the given filename was not already registered.
Needed mainly for tests to avoid multiple registration of the same file and therefore also multiple execution
of e.g. a javascript file during page load.
:param filename: filename to remove
:param app: app object
... |
Removes a given resource file from builder resources.
Needed mostly during test, if multiple sphinx-build are started.
During these tests js/cass-files are not cleaned, so a css_file from run A is still registered in run B.
:param filename: filename to remove
:param app: app object
:return: None
d... |
Detects shreds in the current sheet and constructs Shred instances.
Caches the results for further invocations.
Args:
feature_extractors: iterable of AbstractShredFeature instances to
use for shreds feature assignment.
sheet_name: string, included in shred attri... |
Creates a Shred instances from a given contour.
Args:
c: cv2 contour object.
name: string shred name within a sheet.
feature_extractors: iterable of AbstractShredFeature instances.
Returns:
A new Shred instance or None on failure.
def _make_shred(self, ... |
Return a WKT string for a POLYGON with given amount of sides.
The polygon is defined by its center (random point if not provided) and
the distance (random distance if not provided; in km) of the points to
its center.
def geo_shape(self, sides=5, center=None, distance=None):
"""
... |
Execute a track file
def run_track(track,
result_hosts=None,
crate_root=None,
output_fmt=None,
logfile_info=None,
logfile_result=None,
failfast=False,
sample_mode='reservoir'):
"""Execute a track file"""
with Logg... |
Convert a NOAA text file into a lipds file.
CSV files will be created if chronology or data sections are available.
:return dict: Metadata Dictionary
def main(self):
"""
Convert a NOAA text file into a lipds file.
CSV files will be created if chronology or data sections are avai... |
Parse
Accept the text file. We'll open it, read it, and return a compiled dictionary to write to a json file
May write a chronology CSV and a data CSV if those sections are available
:return:
def __parse(self):
"""
Parse
Accept the text file. We'll open it, read it, and ... |
Receive split list from separate_data_vars, and turn it into a dictionary for that column
:param list l:
:param int col_count:
:return dict:
def __create_paleo_col(l, col_count):
"""
Receive split list from separate_data_vars, and turn it into a dictionary for that column
... |
For the variables section, clean up the line and return a list of each of the 10 items
:param str line:
:return str:
def __separate_data_vars(line):
"""
For the variables section, clean up the line and return a list of each of the 10 items
:param str line:
:return str:
... |
All path items are automatically strings. If you think it's an int or float, this attempts to convert it.
:param str number:
:return float or str:
def __convert_num(number):
"""
All path items are automatically strings. If you think it's an int or float, this attempts to convert it.
... |
Convert underscore naming into camel case naming
:param str word:
:return str:
def __camel_case(word):
"""
Convert underscore naming into camel case naming
:param str word:
:return str:
"""
word = word.lower()
if '_' in word:
split_wor... |
Split a name and unit that are bunched together (i.e. '250m')
:param str word:
:return str str:
def __name_unit_regex(word):
"""
Split a name and unit that are bunched together (i.e. '250m')
:param str word:
:return str str:
"""
value = ""
unit = ... |
Split a string that has value and unit as one.
:param str line:
:return str str:
def __split_name_unit(self, line):
"""
Split a string that has value and unit as one.
:param str line:
:return str str:
"""
vals = []
unit = ''
if line != '' ... |
Remove the unnecessary characters in the line that we don't want
:param str line:
:return str:
def __str_cleanup(line):
"""
Remove the unnecessary characters in the line that we don't want
:param str line:
:return str:
"""
if '#' in line:
line... |
Get the key and value items from a line by looking for and lines that have a ":"
:param str line:
:return str str: Key, Value
def __slice_key_val(line):
"""
Get the key and value items from a line by looking for and lines that have a ":"
:param str line:
:return str str:... |
GeoJSON standard:
Use to determine 2-point or 4-point coordinates
:param list lat:
:param list lon:
:return dict:
def __create_coordinates(self, lat, lon, elev):
"""
GeoJSON standard:
Use to determine 2-point or 4-point coordinates
:param list lat:
... |
GeoJSON standard:
Create a geoJson MultiPoint-type dictionary
:param list lat:
:param list lon:
:return dict:
def __geo_multipoint(lat, lon, elev):
"""
GeoJSON standard:
Create a geoJson MultiPoint-type dictionary
:param list lat:
:param list lon:... |
GeoJSON standard:
Create a geoJson Point-type dictionary
:param list lat:
:param list lon:
:return dict:
def __geo_point(lat, lon, elev):
"""
GeoJSON standard:
Create a geoJson Point-type dictionary
:param list lat:
:param list lon:
:retur... |
Create a valid bib json entry for the DOI information.
"DOI" is technically the only valid DOI key, but there are sometimes a doi_id and doi_url entry.
Check for all three and compare them, then keep whichever seems best.
:param dict temp_pub:
:return dict:
def __reorganize_doi(temp_pub... |
Use to collected chron metadata to create the chron columns
:param dict metadata: key: variable, val: unit (optional)
:return list: list of one dict per column
def __create_chron_cols(metadata):
"""
Use to collected chron metadata to create the chron columns
:param dict metadata... |
Reorganize the list of variables. If there are units given, log them.
:param str line:
:return dict: key: variable, val: units (optional)
def __reorganize_chron_header(line):
"""
Reorganize the list of variables. If there are units given, log them.
:param str line:
:retu... |
Separate the string of authors and put it into a BibJSON compliant list
:param str authors:
:return list: List of dictionaries of author names.
def __reorganize_authors(authors):
"""
Separate the string of authors and put it into a BibJSON compliant list
:param str authors:
... |
DOIs are commonly stored in the BibJson format under "identifier". We want to move these to the root
of the publication under "doi". Make the reassignments necessary and also remove duplicate and unwanted
Doi/DOI keys.
:param dict L: Metadata
:return dict L: Metdata
def fix_doi(L):
"""
DOIs... |
Check what version of LiPD this file is using. If none is found, assume it's using version 1.0
:param dict L: Metadata
:return float:
def get_lipd_version(L):
"""
Check what version of LiPD this file is using. If none is found, assume it's using version 1.0
:param dict L: Metadata
:return float... |
Metadata is indexed by number at this step.
Use the current version number to determine where to start updating from. Use "chain versioning" to make it
modular. If a file is a few versions behind, convert to EACH version until reaching current. If a file is one
version behind, it will only convert once to ... |
Update LiPD v1.0 to v1.1
- chronData entry is a list that allows multiple tables
- paleoData entry is a list that allows multiple tables
- chronData now allows measurement, model, summary, modelTable, ensemble, calibratedAges tables
- Added 'lipdVersion' key
:param dict d: Metadata v1.0
:return... |
Update LiPD v1.2 to v1.3
- Added 'createdBy' key
- Top-level folder inside LiPD archives are named "bag". (No longer <datasetname>)
- .jsonld file is now generically named 'metadata.jsonld' (No longer <datasetname>.lpd )
- All "paleo" and "chron" prefixes are removed from "paleoMeasurementTable", "paleo... |
Update the key names and merge interpretation data
:param dict d: Metadata
:return dict d: Metadata
def update_lipd_v1_3_names(d):
"""
Update the key names and merge interpretation data
:param dict d: Metadata
:return dict d: Metadata
"""
try:
if isinstance(d, dict):
... |
Update the structure for summary and ensemble tables
:param dict d: Metadata
:return dict d: Metadata
def update_lipd_v1_3_structure(d):
"""
Update the structure for summary and ensemble tables
:param dict d: Metadata
:return dict d: Metadata
"""
for key in ["paleoData", "chronData"]:
... |
Using the given metadata dictionary, retrieve CSV data from CSV files, and insert the CSV
values into their respective metadata columns. Checks for both paleoData and chronData tables.
:param dict d: Metadata
:return dict: Modified metadata dictionary
def merge_csv_metadata(d, csvs):
"""
Using the... |
Add csv data to all paleo data tables
:param dict sections: Metadata
:return dict sections: Metadata
def _merge_csv_section(sections, pc, csvs):
"""
Add csv data to all paleo data tables
:param dict sections: Metadata
:return dict sections: Metadata
"""
logger_csvs.info("enter merge_c... |
Add csv data to each column in chron model
:param dict models: Metadata
:return dict models: Metadata
def _merge_csv_model(models, pc, csvs):
"""
Add csv data to each column in chron model
:param dict models: Metadata
:return dict models: Metadata
"""
logger_csvs.info("enter merge_csv... |
Add csv data to each column in a list of columns
:param dict table: Table metadata
:param str crumbs: Hierarchy crumbs
:param str pc: Paleo or Chron table type
:return dict: Table metadata with csv "values" entry
:return bool ensemble: Ensemble data or not ensemble data
def _merge_csv_column(table... |
Opens the target CSV file and creates a dictionary with one list for each CSV column.
:param str filename:
:return list of lists: column values
def read_csv_from_file(filename):
"""
Opens the target CSV file and creates a dictionary with one list for each CSV column.
:param str filename:
:ret... |
Writes columns of data to a target CSV file.
:param dict d: A dictionary containing one list for every data column. Keys: int, Values: list
:return None:
def write_csv_to_file(d):
"""
Writes columns of data to a target CSV file.
:param dict d: A dictionary containing one list for every data colum... |
Two goals. Get all csv from metadata, and return new metadata with generated filenames to match files.
:param str dsn: Dataset name
:param dict d: Metadata
:return dict _csvs: Csv
def get_csv_from_metadata(dsn, d):
"""
Two goals. Get all csv from metadata, and return new metadata with generated fi... |
Get table name, variable name, and column values from paleo metadata
:param dict sections: Metadata
:param str crumbs: Crumbs
:param dict csvs: Csv
:return dict sections: Metadata
:return dict csvs: Csv
def _get_csv_from_section(sections, crumbs, csvs):
"""
Get table name, variable name, a... |
Get csv from model data
:param dict models: Metadata
:param str crumbs: Crumbs
:param dict csvs: Csv
:return dict models: Metadata
:return dict csvs: Csv
def _get_csv_from_model(models, crumbs, csvs):
"""
Get csv from model data
:param dict models: Metadata
:param str crumbs: Crum... |
Search a data tables for column values. Return a dict of column values
:param dict d: Table data
:return dict: Column values. ref by var name
def _get_csv_from_columns(table, filename, csvs):
"""
Search a data tables for column values. Return a dict of column values
:param dict d: Table data
:r... |
Get the filename from a data table. If it doesn't exist, create a new one based on table hierarchy in metadata file.
format: <dataSetName>.<section><idx><table><idx>.csv
example: ODP1098B.Chron1.ChronMeasurementTable.csv
:param dict table: Table data
:param str crumbs: Crumbs
:return str filename: ... |
Preserve the csv column ordering before writing back out to CSV file. Keep column data consistent with JSONLD
column number alignment.
{ "var1" : {"number": 1, "values": [] }, "var2": {"number": 1, "values": [] } }
:param dict d: csv data
:param str filename: Filename
:return dict: csv data
def _r... |
List of lists of csv values data
:param list ll:
:return bool: True, all lists are numeric lists, False, data contains at least one numeric list.
def _is_numeric_data(ll):
"""
List of lists of csv values data
:param list ll:
:return bool: True, all lists are numeric lists, False, data contains ... |
The second column is not typical.
"number" is a list of column numbers and "values" is an array of column values.
Before we can write this to csv, it has to match the format the writer expects.
:param dict ensemble: First column data
:param list col_nums: Second column numbers. list of ints
:param l... |
Format the LIPD data in the layout that the Lipd.net validator accepts.
'_format' example:
[
{"type": "csv", "filenameFull": /path/to/filename.csv, "data": "", ...},
{"type": "json", "filenameFull": /path/to/metadata.jsonld, "data": "", ...},
...
]
:param dict L: Metadata
... |
Use the result from the API call to create an organized single string output for printing to the console.
:param dict result: Results from API call for one file
:return str string: Organized results for printing
def create_detailed_results(result):
"""
Use the result from the API call to create an org... |
Display the results from the validator in a brief or detailed output
:param list results: API results, sorted by dataset name (multiple)
:param bool detailed: Detailed results on or off
:return none:
def display_results(results, detailed=False):
"""
Display the results from the validator in a brie... |
Single call to the lipd.net validator API
'api_data' format:
[
{"type": "csv", "filenameFull": /path/to/filename.csv, "data": "", ...},
{"type": "json", "filenameFull": /path/to/metadata.jsonld, "data": "", ...},
...
]
Result format:
{"dat": <dict>, "feedback": <dict>, ... |
Filters all needs with given configuration
:param current_needlist: needlist object, which stores all filters
:param all_needs: List of all needs inside document
:return: list of needs, which passed the filters
def procces_filters(all_needs, current_needlist):
"""
Filters all needs with given con... |
Filters given needs based on a given filter string.
Returns all needs, which pass the given filter.
:param merge_part_with_parent: If True, need_parts inherit options from their parent need
:param filter_parts: If True, need_parts get also filtered
:param filter_string: strings, which gets evaluated ag... |
Checks if a single need/need_part passes a filter_string
:param need: need or need_part
:param filter_string: string, which is used as input for eval()
:return: True, if need as passed the filter_string, else False
def filter_single_need(need, filter_string=""):
"""
Checks if a single need/need_pa... |
Returns logging level based on boolean
def get_logging_level(debug):
"""Returns logging level based on boolean"""
level = logging.INFO
if debug:
level = logging.DEBUG
return level |
Run a spec file, executing the statements on the benchmark_hosts.
Short example of a spec file:
[setup]
statement_files = ["sql/create_table.sql"]
[[setup.data_files]]
target = "t"
source = "data/t.json"
[[queries]]
statement = "select count(*)... |
Use the given URL and destination to download and save a file
:param str src_url: Direct URL to lipd file download
:param str dst_path: Local path to download file to, including filename and ext. ex. /path/to/filename.lpd
:return none:
def download_from_url(src_url, dst_dir):
"""
Use the given URL ... |
Main function that controls the script. Take in directory containing the .lpd file(s). Loop for each file.
:return None:
def doi_main(files):
"""
Main function that controls the script. Take in directory containing the .lpd file(s). Loop for each file.
:return None:
"""
logger_doi_main.info("en... |
Opens up json file, invokes doi_resolver, closes file, updates changelog, cleans directory, and makes new bag.
:param str name: Name of current .lpd file
:param str dir_tmp: Path to tmp directory
:return none:
def process_lpd(name, dir_tmp):
"""
Opens up json file, invokes doi_resolver, closes file... |
Ask the user if they want to force update files that were previously resolved
:return bool: response
def prompt_force():
"""
Ask the user if they want to force update files that were previously resolved
:return bool: response
"""
logger_doi_main.info("enter prompt_force")
count = 0
prin... |
Replace all needtables nodes with a tale of filtered noded.
:param app:
:param doctree:
:param fromdocname:
:return:
def process_needtables(app, doctree, fromdocname):
"""
Replace all needtables nodes with a tale of filtered noded.
:param app:
:param doctree:
:param fromdocname:
... |
Gets the hierarchy of the section nodes as a list starting at the
section of the current need and then its parent sections
def get_sections(need_info):
"""Gets the hierarchy of the section nodes as a list starting at the
section of the current need and then its parent sections"""
sections = []
curr... |
Gets executed, if a doc file needs to be purged/ read in again.
So this code delete all found needs for the given docname.
def purge_needs(app, env, docname):
"""
Gets executed, if a doc file needs to be purged/ read in again.
So this code delete all found needs for the given docname.
"""
if no... |
Add section titles to the needs as additional attributes that can
be used in tables and filters
def add_sections(app, doctree, fromdocname):
"""Add section titles to the needs as additional attributes that can
be used in tables and filters"""
needs = getattr(app.builder.env, 'needs_all_needs', {})
... |
Event handler to add title meta data (status, tags, links, ...) information to the Need node.
:param app:
:param doctree:
:param fromdocname:
:return:
def process_need_nodes(app, doctree, fromdocname):
"""
Event handler to add title meta data (status, tags, links, ...) information to the Need ... |
Create back-links in all found needs.
But do this only once, as all needs are already collected and this sorting is for all
needs and not only for the ones of the current document.
:param env: sphinx enviroment
:return: None
def create_back_links(env):
"""
Create back-links in all found needs.... |
Constructs the node-structure for the headline/title container
:param need_data: need_info container
:return: node
def construct_headline(need_data, app):
"""
Constructs the node-structure for the headline/title container
:param need_data: need_info container
:return: node
"""
# need ti... |
Constructs the node-structure for the status container
:param need_data: need_info container
:return: node
def construct_meta(need_data, env):
"""
Constructs the node-structure for the status container
:param need_data: need_info container
:return: node
"""
hide_options = env.config.ne... |
This searches a list for dynamic function fragments, which may have been cut by generic searches for ",|;".
Example:
`link_a, [[copy('links', need_id)]]` this will be splitted in list of 3 parts:
#. link_a
#. [[copy('links'
#. need_id)]]
This function fixes the above list to the following:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.