io
Module¶
- filename_to_dict(filename)¶
Returns a dictionay of values based on the pendulum data file name.
- load_parameter_text_file(pathToFile)¶
Returns a dictionary of float and/or ufloat parameters from a parameter file.
- Parameters:
- pathToFilestring
The path to the text file with the parameters listed in the specified format.
- Returns:
- parametersdictionary
A dictionary of the values stored in the text files.
- For example::
c = 0.08 +/- 0.01 d=0.314+/-0.002 t = 0.1+/-0.01, 0.12+/-0.02 whb = 0.5
- The first item on the line must be the variable name and the second is an
- equals sign. The values to the right of the equal sign much may or may not
- contain an uncertainty designated by +/-. Multiple comma seperated values
- will be averaged.
- load_pendulum_mat_file(pathToFile)¶
Returns a dictionay containing the data from the pendulum data mat file.
- remove_uncertainties(dictionary)¶
Returns a dictionary with the uncertainties removed.
- space_out_camel_case(s, output='string')¶
Adds spaces to a camel case string. Failure to space out string returns the original string.
Examples
>>> space_out_camel_case('DMLSServicesOtherBSTextLLC') 'DMLS Services Other BS Text LLC' >>> space_out_camel_case('DMLSServicesOtherBSTextLLC', output='list') ['DMLS', 'Services', 'Other', 'BS', 'Text', 'LLC']
- write_parameter_text_file(pathToTxtFile, parDict)¶
Writes parameter set to file.
- Parameters:
- pathToTxtFilestring
The path to the file to write the parameters.
- pardictdictionary
A dictionary of parameters for the bicycle.
- Returns:
- savedboolean
True if the file was saved and false if not.
- write_periods_to_file(pathToRawFile, mp)¶
Writes the provided periods to file.
- Parameters:
- pathToRawFilestring
The path to the <bicycle name>Measured.txt file
- mpdictionary
The measured parameters dictionary. Should contain complete period data.