Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
craig8 committed Oct 15, 2019
1 parent a758904 commit 0d3077f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
18 changes: 9 additions & 9 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ the following python code shows how to get the correct topic for the service.
from gridappsd import topics
read_topic = topic.service_output_topic("sensors", simulation_id)
read_topic = topic.service_output_topic("gridappsd-sensor-simulator", simulation_id)
Service Configuration
---------------------
Expand All @@ -40,8 +40,8 @@ or use the specified values during the service runtime.
{
"_99db0dc7-ccda-4ed5-a772-a7db362e9818": {
"nominal-voltage": 100,
"perunit-confidence-rate": 0.95,
"nominal-value": 100,
"perunit-confidence-band": 0.01,
"aggregation-interval": 30,
"perunit-drop-rate": 0.01
},
Expand All @@ -51,7 +51,7 @@ or use the specified values during the service runtime.
The other options for the service are:

* default-perunit-confidence-rate
* default-perunit-confidence-band
* default-aggregation-interval
* default-perunit-drop-rate
* passthrough-if-not-specified
Expand All @@ -60,8 +60,8 @@ These options will be used when not specified within the sensor-config block.

.. note::

Currently the nominal-voltage is not looked up from the database. At this time services aren't able to tell
the platform when they are "ready". This will be implemented in the near future and then all of the nominal-voltages
Currently the nominal-value is not looked up from the database. At this time services aren't able to tell
the platform when they are "ready". This will be implemented in the near future and then all of the nominal-values
will be queried from the database.

Request Example
Expand Down Expand Up @@ -111,8 +111,8 @@ published to the output sensor output topic.
"user_options": {
"sensors-config": {
"_99db0dc7-ccda-4ed5-a772-a7db362e9818": {
"nominal-voltage": 100,
"perunit-confidence-rate": 0.95,
"nominal-value": 100,
"perunit-confidence-band": 0.02,
"aggregation-interval": 5,
"perunit-drop-rate": 0.01
},
Expand All @@ -122,7 +122,7 @@ published to the output sensor output topic.
"random-seed": 0,
"default-aggregation-interval": 30,
"passthrough-if-not-specified": false,
"default-perunit-confidence-rate": 0.95,
"default-perunit-confidence-band": 0.01,
"default-perunit-drop-rate": 0.05
}
}]
Expand Down
6 changes: 6 additions & 0 deletions sensor_simulator.config
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@
"type": "float",
"default_value": 30
},
"default-normal-value": {
"help": "The normal value of voltage (note currently tied to magnitude of sensor value)",
"help_example": 100,
"type": "int",
"default_value": 100
},
"default-perunit-drop-rate": {
"help": "Sets the default perunit drop rate for the equipment",
"help_example": 0.01,
Expand Down
12 changes: 5 additions & 7 deletions sensors/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"default-perunit-confidence-band": 2,
"default-aggregation-interval": 30,
"default-perunit-drop-rate": 0.01,
'default-nominal-voltage': 100
'default-normal-value': 100
}


Expand All @@ -23,14 +23,14 @@ def __init__(self, gridappsd, read_topic, write_topic, user_options: dict = None
{
"sensors-config": {
"_001cc221-d6e6-485d-bdcc-b84cb643d1ec": {
"nominal-voltage": 100,
"normal-value": 100,
"perunit-confidence-band": 0.01,
"aggregation-interval": 30,
"perunit-drop-rate": 0.01
},
"_0031ff7c-5140-47cf-b750-0146bb3d9024": {},
"_00313f7c-5140-47cf-b750-0146bb3d9024": {
"nominal-voltage": 35
"normal-value": 35
},
"default-perunit-confidence-band": 0.01,
"default-aggregation-interval": 30,
Expand Down Expand Up @@ -99,8 +99,8 @@ def __init__(self, gridappsd, read_topic, write_topic, user_options: dict = None
DEFAULT_SENSOR_CONFIG['default-perunit-drop-rate'])
self.default_aggregation_interval = user_options.get("default-aggregation-interval",
DEFAULT_SENSOR_CONFIG['default-aggregation-interval'])
self.default_normal_value = user_options.get('default-nominal-voltage',
DEFAULT_SENSOR_CONFIG['default-nominal-voltage'])
self.default_normal_value = user_options.get('default-normal-value',
DEFAULT_SENSOR_CONFIG['default-normal-value'])

_log.debug(f"sensors_config is: {sensors_config}")
random.seed(self._random_seed)
Expand Down Expand Up @@ -169,8 +169,6 @@ def on_simulation_message(self, headers, message):

# Create new values for data from the sensor.
for prop, value in item.items():
# TODO: this only processes 'magnitude' and 'value'
# it needs to also process 'angle' but with different noise
if prop in ('measurement_mrid',):
new_measurement[prop] = value
continue
Expand Down

0 comments on commit 0d3077f

Please sign in to comment.