banana.navigator package
- banana.navigator.launch_navigator(imports=None, cfg_path=None, skip_cfg=False, pylab=True)[source]
Launch navigator.
- Parameters:
imports (list(str)) – name of packages/modules to be imported (the whole content is directly imported in the global namespace); if
Noneis considered to be empty (default:None)cfg_path (str or os.PathLike) – path to configuration file or containing folder (if using the conventional name
banana.cfg.name); ifNoneor pointing to a non-existing file, automatic detection is attempted (default:None)skip_cfg (bool) – whether to skip configurations loading; useful if this function is invoked by a script, that is pre-loading configurations on its own (default:
False)pylab (bool) – whether to load
matplotlib.pylabmembers in the global namespace (default:True)
Submodules
banana.navigator.navigator module
- class banana.navigator.navigator.NavigatorApp(cfgpath, external=None)[source]
Bases:
ABCNavigator base class holding all elementry operations.
- Parameters:
cfgpath (str or os.PathLike) – path to banana configuration
external (str) – mode identifier
- compare_external(dfd1, dfd2)[source]
Compare two results in the cache.
It’s taking two results from external benchmarks and compare them in a single table.
- get(table, doc_id)[source]
Table getter wrapper.
- Parameters:
table (str) – table identifier
doc_id (int or str) – it can be: a
strinterpreted as partial hash (banana.data.sql.select_by_hash()), a non-negativeintinterpreted as the record unique identifier (banana.data.sql.select_by_uid()), a negativeintinterpreted as record position (banana.data.sql.select_by_position())
- Returns:
the retrieved document
- Return type:
- hash_len = 6
- abstract static is_valid_physical_object(name)[source]
Identifies physical objects.
Used to test names, in order to distinguish physical quantities from metadata.
- list_all(table, input_data=None, cut_hash=True)[source]
List all elements in a nice table.
- Parameters:
- Returns:
df – list
- Return type:
- list_all_similar_logs(doc_id)[source]
List logs with similar input.
Search logs which are similar to the one given, i.e., same theory and, same observable, and same pdfset.
- Parameters:
- Returns:
df – created frame
- Return type:
Note
The external it’s not used to discriminate logs: even different externals should return the same numbers, so it’s relevant to keep all of them.
- myname = 'banana'
- show_full_logs(t_fields=None, o_fields=None, keep_hashes=False)[source]
Show additional, associated fields in the logs (JOIN).
- Parameters:
- Returns:
df – data frame
- Return type:
- subtract_tables(dfd1, dfd2)[source]
Subtract comparison tables.
Subtract results in the second table from the first one, properly propagate the integration error and recompute the relative error on the subtracted results.
- table_manager(table)[source]
Get corresponding TableManager
- Parameters:
table (str) – table identifier
- Returns:
tm – corresponding TableManager
- Return type:
yadmark.table_manager.TableManager
- table_objects = {'c': <class 'banana.data.db.Cache'>, 'l': <class 'banana.data.db.Log'>, 't': <class 'banana.data.db.Theory'>}
banana.navigator.table_manager module
- class banana.navigator.table_manager.TableManager(session, table_object)[source]
Bases:
objectWrapper to a single table
- Parameters:
session (sqlalchemy.orm.session.Session) – DB ORM session
table_object (sqlalchemy.ext.declarative.api.DeclarativeMeta) – table object
- get(hash_or_uid)[source]
Retrieve an entry
- Parameters:
if
strpartial hash to match (corresponding to the firstlen(hash_or_uid)characters of the hash), ifint:if positive: the uid of the record to retrieve
if negative: position from last
- Returns:
the retrieved entry
- Return type:
- Raises:
sql.RetrieveError – if not a single entry corresponds to the give identifier (so both for no entries and multiple entries)
banana.navigator.utils module
- banana.navigator.utils.compare_dicts(d1, d2, exclude_underscored=False, key_width=20, value_width=30, exclude_keys=None)[source]
Compare similar dictionaries.
Check which entries of the two dictionaries are different, and output the values.
- Parameters:
d1 (dict) – first dict
d2 (dict) – second dict
exclude_underscored (bool) – skip keys prefixed with _ (default:
False)key_width (int) – print width of key (default:
20)value_width (int) – print width of values (default:
30)exclude_keys (None or list) – if not
None, keys contained in this list do not take part in the comparison