Sensortoolkit

Latest version: v1.0.0

Safety actively analyzes 681812 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.9.0b1

This is a test release to fix a number of critical bugs for running the library

0.8.6b2

Code - New Features
- Add dedicated module get_reference_method() for retrieving name of reference method, includes interactive component that requests user to select specific reference method name if multiple instruments are associated with a AQS parameter code / method code combination.
- Reference method make and model lookup tables: Improvements to table formatting (improve consistency in labeling, instrument make and model are clearly identified for use in code).

Code - Modifications

Reference API Query
- Modify reference name lookup to use get_reference_method() module, streamlines lookup so that same for both criteria and met parameters. Add functionality to ref_api_query() to either select the reference method for each monthly query or use the selection indicated for the first monthly query if multiple months of data are requested. In ref_api_query() move code for creating param_dict dictionary to standalone method. Add check at top of ref_api_query() to determine whether query type is "AQS" or "AirNow", if neither then raise ValueError.

Pre-processing AirNow-Tech Datasets
- Use get_reference_method() module for assigning reference name, simplifies a lot of the name assignment by removing need for code that replaces various phrases or conditional statements for certain types of method codes. Also add hyphen to "AirNow-Tech" when indicating the reference data source in processed data files.
Reference Interactive Setup
- Modify reference instrument lookup table visualization to revised table format (display instrument make and model in single column, change name of "method code" and "method type" columns to "code" and "desig." respectively, use "pretty" format for table - slightly reduces the width of the table as printed, see tabulate package documentation for more examples of different table visualizations https://github.com/astanin/python-tabulate).

0.8.5b1

Documentation

- Fix issue where setup description for local reference data was incorrectly formatted.
- Modify width of method table printed to console in reference setup module so that the pdf version of the documentation does not wrap onto a second line
- Set precision for float values in statistics data sets (stats_df.csv and avg_stats_df.csv) to the hundredths place

Code

PerformanceReport

- Remove uptime disclaimer from reporting templates for PM2.5 and O3 report (disclaimer was being shown on additional report pages due to being included in the additional page slide template). Disclaimer moved to the PerformanceReport method, fixes issue with disclaimer being incorrectly shown on additional report pages other than the tabular statistics page.
- If only one sensor in an evaluation group, include N/A disclaimer on CV and SD plots indicating that those metrics are only valid for >= 3 sensors. Also add scaled upper limit for NRMSE so that the plot scales to 1.5 X max metric value like the other subplots.
- If latitude and longitude coordinates are specified, they will be used to determine the local time zone for displaying the start and end timestamps of the evaluation. In the report header, replace the month and year the report was compiled with the month and year that the evaluation took place (if the eval spanned multiple months, use em-dash to indicate spanning month A to B). Modify the formatting of the overall start and end timestamps. Also change how the serial id 3x3 cells in the Sensor Information table is iterated by using the iter_cells() method in python-pptx. If the number of sensors is 1, 3, or 6, merge the 3x3 grid into either a single cell, or one or two rows, respectively. Move uptime disclaimer for the tabular statistics page to be placed programmatically. Change name of Sensor-FRM/FEM Correlation tabular stats section to "Sensor-FRM/FEM Agreement". If only one sensor in deployment, do not include average row for sensor-reference agreement table.
- Add timezonefinder package to dependencies (required by PerformanceReport for locating tzone based on lat/lon for site).
- Revise structure for adding dots that indicate the number of sensors meeting/not meeting a performance target for tabular stats. This feature was not work correctly for instances with only one sensor in the evaluation group and has been corrected to work for 1 or multiple sensors in an evaluation group.
Plotting
- For normalize meteorological scatter plots, changed default for the x-axis label from the name of the meteorological instrument and associated parameter and units to simply indicated ’Reference [parameter name] (parameter units)’. Resolves issue where occasionally the name of the meteorological instrument is not very descriptive as assigned by the AQS method code lookup table.
- Add "Reference" to x-axis labels (if using sensor data, replace with "Sensor" to clearly indicate using sensor data)
- Revise name of code section for placing R^2 in scatter plot text to proper metric name

Calculate

- Add condition for if only one sensor if evaluation, set precision metrics to NaN.
- Move unit conversion methods out of convert_temp() to be used as methods applied on a series (return converted value, if TypeError raised, return Nan)
Ingest
- In standard_ingest(), add option for temperature conversion from Celsius to Fahrenheit for instances where the intended temperature unit basis is F and the data were recorded in C.

Misc.

- Ensure that default project path variable stores path as string (fixes issue where path was stored as pure Windows path, resulted in conditional test for checking whether project path == default project path resolving to False when the check should be true)
- Add temp_units attribute to sensortoolkit.presets class. Allows user to specify which unit basis to use for temperature measurements. Select from 'C' (Celsius, default option) or 'F' (Fahrenheit). Under the hood, this modifies the Parameter object dictionary __param_dict__ used for assigning attributes to Parameter instances.
- Unit check for temperature is modified so that the expected units of measure reflect what the user may have previously configured using the presets.temp_units attribute prior to running the setup module.

0.8.4b1

Sensor Data Ingestion:

- Replace lists for full, 1-hour averaged, and 24-hour averaged datasets for use as data containers with a data dictionary consistent with the AirSensor.data structure. This is a structural change that doesn't impact the front-facing user end API.

Plotting:

- Set the default y-limit minimum for plots to -1 (changed from 0).
- If the number of sensors shown on either a timeseries or normalized meteorological influence scatter plot is one, default to a preset color (a blue hue) for line/scatter points.

Documentation:

- Reorganize sections so that the readthedocs.org theme properly formats the sections in the auto generated pdf as separate chapters.

Miscellaneous:

- Add URLs for documentation, source code, issue tracking, and the Air Sensor Toolbox to the setup.py file for displaying on PyPI.org.

0.8.3b2

Further stability improvements for use with macOS. Replace instances where paths are hard coded with use of os.path.join() to allow os-dependent paths to be formed at code execution.

0.8.3b1

Stability improvements for compatibility with macOS:

- Fixes issues with specifying directory paths for data and figures

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.