adios_db.data_sources.exxon_assays.v2 package

Submodules

adios_db.data_sources.exxon_assays.v2.mapper module

Exxon Mapper Version 1

Not really a class – it’s really a function that build up an oil object

adios_db.data_sources.exxon_assays.v2.mapper.ExxonMapperV2(record)

Accepts and Exxon record:

tuple of:
  • oil name

  • list of lists of the spreadsheet contents

returns an Oil Object

adios_db.data_sources.exxon_assays.v2.mapper.apply_mapping(sample, value, attr, unit, cls, unit_type=None, convert_from=None, element_of=None, num_digits=5, groups=None)
adios_db.data_sources.exxon_assays.v2.mapper.create_middle_tier_objs(samples)

These are the dataclasses that comprise the attributes of the Sample

adios_db.data_sources.exxon_assays.v2.mapper.find_sample(samples, name)
adios_db.data_sources.exxon_assays.v2.mapper.flatten_2d(list_in)
adios_db.data_sources.exxon_assays.v2.mapper.generate_samples(data)

Generate a list of sample names with column indexes, and an associated list of not-yet-populated sample objects.

adios_db.data_sources.exxon_assays.v2.mapper.get_cut_item(sample_ranges, first, last, label)
adios_db.data_sources.exxon_assays.v2.mapper.get_reference(data)

Get the reference information

adios_db.data_sources.exxon_assays.v2.mapper.load_densities(samples, cut_table)

There is only one density per sample, but it is not a simple mapping.

adios_db.data_sources.exxon_assays.v2.mapper.load_distillation_data(samples, graph_data)

We will load the distillation graph data on the first sample only

adios_db.data_sources.exxon_assays.v2.mapper.load_metadata(oil, name, reference, general_info, whole_crude_properties)

Here we will load all the oil metadata from the source data

adios_db.data_sources.exxon_assays.v2.mapper.load_viscosities(samples, cut_table)
adios_db.data_sources.exxon_assays.v2.mapper.normalize_samples(samples)

Not sure what to call this function. Basically, we will fix any data issues that couldn’t be handled in the mapping stages.

adios_db.data_sources.exxon_assays.v2.mapper.read_cut_table(sample_names, data)

Read the rest of the rows and save them in a dictionary.

  • key: sample name

  • value: the rest of the fields as a dict.

adios_db.data_sources.exxon_assays.v2.mapper.read_general_info(data)
adios_db.data_sources.exxon_assays.v2.mapper.read_molecules(data)
adios_db.data_sources.exxon_assays.v2.mapper.read_whole_crude_properties(data)
adios_db.data_sources.exxon_assays.v2.mapper.sample_id_attrs(name)
adios_db.data_sources.exxon_assays.v2.mapper.set_all_sample_properties(samples, cut_table, molecules, whole_crude_properties)
adios_db.data_sources.exxon_assays.v2.mapper.set_boiling_point_range(samples, cut_table)

Parse the names to determine the boiling point ranges Requires the sample names to be initialized

Need to know: - Initial boiling point (IBF) - End boiling point (FBP)

Note: The new format assay doesn’t appear to have definite number fields

for IBP and FBP.

adios_db.data_sources.exxon_assays.v2.mapper.set_sample_properties(sample, sample_properties)
adios_db.data_sources.exxon_assays.v2.mapper.set_sample_property(sample, name, value)

Set a single property of a sample object. The mapping table will control how the property get set.

adios_db.data_sources.exxon_assays.v2.mapper.slice_record(record, position, size)

Slice a 2d portion of our record, which is a 2d list of lists.