ents 2.3.2__tar.gz → 2.3.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. {ents-2.3.2 → ents-2.3.3}/PKG-INFO +2 -2
  2. {ents-2.3.2 → ents-2.3.3}/pyproject.toml +2 -2
  3. {ents-2.3.2 → ents-2.3.3}/src/ents/cli.py +3 -3
  4. {ents-2.3.2 → ents-2.3.3}/src/ents/proto/decode.py +4 -2
  5. {ents-2.3.2 → ents-2.3.3}/src/ents/proto/soil_power_sensor_pb2.py +11 -11
  6. {ents-2.3.2 → ents-2.3.3}/tests/test_generic.py +23 -2
  7. ents-2.3.2/src/ents/calibrate/requirements.txt +0 -9
  8. {ents-2.3.2 → ents-2.3.3}/.gitignore +0 -0
  9. {ents-2.3.2 → ents-2.3.3}/LICENSE +0 -0
  10. {ents-2.3.2 → ents-2.3.3}/README.md +0 -0
  11. {ents-2.3.2 → ents-2.3.3}/src/ents/__init__.py +0 -0
  12. {ents-2.3.2 → ents-2.3.3}/src/ents/calibrate/PingSMU.py +0 -0
  13. {ents-2.3.2 → ents-2.3.3}/src/ents/calibrate/PingSPS.py +0 -0
  14. {ents-2.3.2 → ents-2.3.3}/src/ents/calibrate/README.md +0 -0
  15. {ents-2.3.2 → ents-2.3.3}/src/ents/calibrate/__init__.py +0 -0
  16. {ents-2.3.2 → ents-2.3.3}/src/ents/calibrate/linear_regression.py +0 -0
  17. {ents-2.3.2 → ents-2.3.3}/src/ents/calibrate/plots.py +0 -0
  18. {ents-2.3.2 → ents-2.3.3}/src/ents/calibrate/recorder.py +0 -0
  19. {ents-2.3.2 → ents-2.3.3}/src/ents/config/README.md +0 -0
  20. {ents-2.3.2 → ents-2.3.3}/src/ents/config/__init__.py +0 -0
  21. {ents-2.3.2 → ents-2.3.3}/src/ents/config/adv_trace.py +0 -0
  22. {ents-2.3.2 → ents-2.3.3}/src/ents/config/user_config.py +0 -0
  23. {ents-2.3.2 → ents-2.3.3}/src/ents/proto/__init__.py +0 -0
  24. {ents-2.3.2 → ents-2.3.3}/src/ents/proto/encode.py +0 -0
  25. {ents-2.3.2 → ents-2.3.3}/src/ents/proto/esp32.py +0 -0
  26. {ents-2.3.2 → ents-2.3.3}/src/ents/simulator/__init__.py +0 -0
  27. {ents-2.3.2 → ents-2.3.3}/src/ents/simulator/node.py +0 -0
  28. {ents-2.3.2 → ents-2.3.3}/tests/__init__.py +0 -0
  29. {ents-2.3.2 → ents-2.3.3}/tests/test_simulator.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ents
3
- Version: 2.3.2
3
+ Version: 2.3.3
4
4
  Summary: Python package for Environmental NeTworked Sensor (ENTS)
5
5
  Project-URL: Homepage, https://github.com/jlab-sensing/soil-power-sensor-firmware
6
6
  Project-URL: Issues, https://github.com/jlab-sensing/soil-power-sensor-firmware/issues
@@ -12,7 +12,7 @@ Classifier: Programming Language :: Python :: 3
12
12
  Requires-Python: >=3.11
13
13
  Requires-Dist: matplotlib
14
14
  Requires-Dist: pandas
15
- Requires-Dist: protobuf>5.0.0
15
+ Requires-Dist: protobuf==6.31.1
16
16
  Requires-Dist: pyserial
17
17
  Requires-Dist: requests
18
18
  Requires-Dist: scikit-learn
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "ents"
7
- version = "2.3.2"
7
+ version = "2.3.3"
8
8
  authors = [
9
9
  { name="John Madden", email="jmadden173@pm.me" },
10
10
  ]
@@ -17,7 +17,7 @@ classifiers = [
17
17
  "Operating System :: OS Independent",
18
18
  ]
19
19
  dependencies = [
20
- 'protobuf>5.0.0',
20
+ 'protobuf==6.31.1',
21
21
  'matplotlib',
22
22
  'pandas',
23
23
  'pyserial',
@@ -464,9 +464,9 @@ def calibrate(args):
464
464
  V_STOP = 2.0
465
465
  V_STEP = 0.5
466
466
 
467
- I_START = -0.009
468
- I_STOP = 0.009
469
- I_STEP = 0.0045
467
+ I_START = -0.0009
468
+ I_STOP = 0.0009
469
+ I_STEP = 0.00045
470
470
 
471
471
  def record_calibrate(start, stop, step, name: str):
472
472
  """Record and calibrate
@@ -51,13 +51,15 @@ def decode_measurement(data: bytes, raw: bool = True) -> dict:
51
51
  # convert meta into dict
52
52
  if not meas.HasField("meta"):
53
53
  raise KeyError("Measurement missing metadata")
54
- meta_dict = MessageToDict(meas.meta)
54
+ meta_dict = MessageToDict(meas.meta, always_print_fields_with_no_presence=True)
55
55
 
56
56
  # decode measurement
57
57
  if not meas.HasField("measurement"):
58
58
  raise KeyError("Measurement missing data")
59
59
  measurement_type = meas.WhichOneof("measurement")
60
- measurement_dict = MessageToDict(getattr(meas, measurement_type))
60
+ measurement_dict = MessageToDict(
61
+ getattr(meas, measurement_type), always_print_fields_with_no_presence=True
62
+ )
61
63
 
62
64
  # store measurement type
63
65
  meta_dict["type"] = measurement_type
@@ -2,7 +2,7 @@
2
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
3
3
  # NO CHECKED-IN PROTOBUF GENCODE
4
4
  # source: soil_power_sensor.proto
5
- # Protobuf Python Version: 6.30.1
5
+ # Protobuf Python Version: 6.31.1
6
6
  """Generated protocol buffer code."""
7
7
  from google.protobuf import descriptor as _descriptor
8
8
  from google.protobuf import descriptor_pool as _descriptor_pool
@@ -12,7 +12,7 @@ from google.protobuf.internal import builder as _builder
12
12
  _runtime_version.ValidateProtobufRuntimeVersion(
13
13
  _runtime_version.Domain.PUBLIC,
14
14
  6,
15
- 30,
15
+ 31,
16
16
  1,
17
17
  '',
18
18
  'soil_power_sensor.proto'
@@ -24,17 +24,17 @@ _sym_db = _symbol_database.Default()
24
24
 
25
25
 
26
26
 
27
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x17soil_power_sensor.proto\"E\n\x13MeasurementMetadata\x12\x0f\n\x07\x63\x65ll_id\x18\x01 \x01(\r\x12\x11\n\tlogger_id\x18\x02 \x01(\r\x12\n\n\x02ts\x18\x03 \x01(\r\"4\n\x10PowerMeasurement\x12\x0f\n\x07voltage\x18\x02 \x01(\x01\x12\x0f\n\x07\x63urrent\x18\x03 \x01(\x01\"P\n\x12Teros12Measurement\x12\x0f\n\x07vwc_raw\x18\x02 \x01(\x01\x12\x0f\n\x07vwc_adj\x18\x03 \x01(\x01\x12\x0c\n\x04temp\x18\x04 \x01(\x01\x12\n\n\x02\x65\x63\x18\x05 \x01(\r\"6\n\x12Teros21Measurement\x12\x12\n\nmatric_pot\x18\x01 \x01(\x01\x12\x0c\n\x04temp\x18\x02 \x01(\x01\"<\n\x13Phytos31Measurement\x12\x0f\n\x07voltage\x18\x01 \x01(\x01\x12\x14\n\x0cleaf_wetness\x18\x02 \x01(\x01\"L\n\x11\x42ME280Measurement\x12\x10\n\x08pressure\x18\x01 \x01(\r\x12\x13\n\x0btemperature\x18\x02 \x01(\x05\x12\x10\n\x08humidity\x18\x03 \x01(\r\"\x84\x02\n\x0bMeasurement\x12\"\n\x04meta\x18\x01 \x01(\x0b\x32\x14.MeasurementMetadata\x12\"\n\x05power\x18\x02 \x01(\x0b\x32\x11.PowerMeasurementH\x00\x12&\n\x07teros12\x18\x03 \x01(\x0b\x32\x13.Teros12MeasurementH\x00\x12(\n\x08phytos31\x18\x04 \x01(\x0b\x32\x14.Phytos31MeasurementH\x00\x12$\n\x06\x62me280\x18\x05 \x01(\x0b\x32\x12.BME280MeasurementH\x00\x12&\n\x07teros21\x18\x06 \x01(\x0b\x32\x13.Teros21MeasurementH\x00\x42\r\n\x0bmeasurement\"X\n\x08Response\x12$\n\x04resp\x18\x01 \x01(\x0e\x32\x16.Response.ResponseType\"&\n\x0cResponseType\x12\x0b\n\x07SUCCESS\x10\x00\x12\t\n\x05\x45RROR\x10\x01\"\x8b\x01\n\x0c\x45sp32Command\x12$\n\x0cpage_command\x18\x01 \x01(\x0b\x32\x0c.PageCommandH\x00\x12$\n\x0ctest_command\x18\x02 \x01(\x0b\x32\x0c.TestCommandH\x00\x12$\n\x0cwifi_command\x18\x03 \x01(\x0b\x32\x0c.WiFiCommandH\x00\x42\t\n\x07\x63ommand\"\xb6\x01\n\x0bPageCommand\x12.\n\x0c\x66ile_request\x18\x01 \x01(\x0e\x32\x18.PageCommand.RequestType\x12\x17\n\x0f\x66ile_descriptor\x18\x02 \x01(\r\x12\x12\n\nblock_size\x18\x03 \x01(\r\x12\x11\n\tnum_bytes\x18\x04 \x01(\r\"7\n\x0bRequestType\x12\x08\n\x04OPEN\x10\x00\x12\t\n\x05\x43LOSE\x10\x01\x12\x08\n\x04READ\x10\x02\x12\t\n\x05WRITE\x10\x03\"\x82\x01\n\x0bTestCommand\x12\'\n\x05state\x18\x01 \x01(\x0e\x32\x18.TestCommand.ChangeState\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x05\"<\n\x0b\x43hangeState\x12\x0b\n\x07RECEIVE\x10\x00\x12\x13\n\x0fRECEIVE_REQUEST\x10\x01\x12\x0b\n\x07REQUEST\x10\x02\"\xc1\x01\n\x0bWiFiCommand\x12\x1f\n\x04type\x18\x01 \x01(\x0e\x32\x11.WiFiCommand.Type\x12\x0c\n\x04ssid\x18\x02 \x01(\t\x12\x0e\n\x06passwd\x18\x03 \x01(\t\x12\x0b\n\x03url\x18\x04 \x01(\t\x12\x0c\n\x04port\x18\x08 \x01(\r\x12\n\n\x02rc\x18\x05 \x01(\r\x12\n\n\x02ts\x18\x06 \x01(\r\x12\x0c\n\x04resp\x18\x07 \x01(\x0c\"2\n\x04Type\x12\x0b\n\x07\x43ONNECT\x10\x00\x12\x08\n\x04POST\x10\x01\x12\t\n\x05\x43HECK\x10\x02\x12\x08\n\x04TIME\x10\x03\"\xdc\x02\n\x11UserConfiguration\x12\x11\n\tlogger_id\x18\x01 \x01(\r\x12\x0f\n\x07\x63\x65ll_id\x18\x02 \x01(\r\x12$\n\rUpload_method\x18\x03 \x01(\x0e\x32\r.Uploadmethod\x12\x17\n\x0fUpload_interval\x18\x04 \x01(\r\x12\'\n\x0f\x65nabled_sensors\x18\x05 \x03(\x0e\x32\x0e.EnabledSensor\x12\x15\n\rVoltage_Slope\x18\x06 \x01(\x01\x12\x16\n\x0eVoltage_Offset\x18\x07 \x01(\x01\x12\x15\n\rCurrent_Slope\x18\x08 \x01(\x01\x12\x16\n\x0e\x43urrent_Offset\x18\t \x01(\x01\x12\x11\n\tWiFi_SSID\x18\n \x01(\t\x12\x15\n\rWiFi_Password\x18\x0b \x01(\t\x12\x18\n\x10\x41PI_Endpoint_URL\x18\x0c \x01(\t\x12\x19\n\x11\x41PI_Endpoint_Port\x18\r \x01(\r*O\n\rEnabledSensor\x12\x0b\n\x07Voltage\x10\x00\x12\x0b\n\x07\x43urrent\x10\x01\x12\x0b\n\x07Teros12\x10\x02\x12\x0b\n\x07Teros21\x10\x03\x12\n\n\x06\x42ME280\x10\x04*\"\n\x0cUploadmethod\x12\x08\n\x04LoRa\x10\x00\x12\x08\n\x04WiFi\x10\x01\x62\x06proto3')
27
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x17soil_power_sensor.proto\"E\n\x13MeasurementMetadata\x12\x0f\n\x07\x63\x65ll_id\x18\x01 \x01(\r\x12\x11\n\tlogger_id\x18\x02 \x01(\r\x12\n\n\x02ts\x18\x03 \x01(\r\"4\n\x10PowerMeasurement\x12\x0f\n\x07voltage\x18\x02 \x01(\x01\x12\x0f\n\x07\x63urrent\x18\x03 \x01(\x01\"P\n\x12Teros12Measurement\x12\x0f\n\x07vwc_raw\x18\x02 \x01(\x01\x12\x0f\n\x07vwc_adj\x18\x03 \x01(\x01\x12\x0c\n\x04temp\x18\x04 \x01(\x01\x12\n\n\x02\x65\x63\x18\x05 \x01(\r\"6\n\x12Teros21Measurement\x12\x12\n\nmatric_pot\x18\x01 \x01(\x01\x12\x0c\n\x04temp\x18\x02 \x01(\x01\"<\n\x13Phytos31Measurement\x12\x0f\n\x07voltage\x18\x01 \x01(\x01\x12\x14\n\x0cleaf_wetness\x18\x02 \x01(\x01\"L\n\x11\x42ME280Measurement\x12\x10\n\x08pressure\x18\x01 \x01(\r\x12\x13\n\x0btemperature\x18\x02 \x01(\x05\x12\x10\n\x08humidity\x18\x03 \x01(\r\"\x84\x02\n\x0bMeasurement\x12\"\n\x04meta\x18\x01 \x01(\x0b\x32\x14.MeasurementMetadata\x12\"\n\x05power\x18\x02 \x01(\x0b\x32\x11.PowerMeasurementH\x00\x12&\n\x07teros12\x18\x03 \x01(\x0b\x32\x13.Teros12MeasurementH\x00\x12(\n\x08phytos31\x18\x04 \x01(\x0b\x32\x14.Phytos31MeasurementH\x00\x12$\n\x06\x62me280\x18\x05 \x01(\x0b\x32\x12.BME280MeasurementH\x00\x12&\n\x07teros21\x18\x06 \x01(\x0b\x32\x13.Teros21MeasurementH\x00\x42\r\n\x0bmeasurement\"X\n\x08Response\x12$\n\x04resp\x18\x01 \x01(\x0e\x32\x16.Response.ResponseType\"&\n\x0cResponseType\x12\x0b\n\x07SUCCESS\x10\x00\x12\t\n\x05\x45RROR\x10\x01\"\x8b\x01\n\x0c\x45sp32Command\x12$\n\x0cpage_command\x18\x01 \x01(\x0b\x32\x0c.PageCommandH\x00\x12$\n\x0ctest_command\x18\x02 \x01(\x0b\x32\x0c.TestCommandH\x00\x12$\n\x0cwifi_command\x18\x03 \x01(\x0b\x32\x0c.WiFiCommandH\x00\x42\t\n\x07\x63ommand\"\xb6\x01\n\x0bPageCommand\x12.\n\x0c\x66ile_request\x18\x01 \x01(\x0e\x32\x18.PageCommand.RequestType\x12\x17\n\x0f\x66ile_descriptor\x18\x02 \x01(\r\x12\x12\n\nblock_size\x18\x03 \x01(\r\x12\x11\n\tnum_bytes\x18\x04 \x01(\r\"7\n\x0bRequestType\x12\x08\n\x04OPEN\x10\x00\x12\t\n\x05\x43LOSE\x10\x01\x12\x08\n\x04READ\x10\x02\x12\t\n\x05WRITE\x10\x03\"\x82\x01\n\x0bTestCommand\x12\'\n\x05state\x18\x01 \x01(\x0e\x32\x18.TestCommand.ChangeState\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x05\"<\n\x0b\x43hangeState\x12\x0b\n\x07RECEIVE\x10\x00\x12\x13\n\x0fRECEIVE_REQUEST\x10\x01\x12\x0b\n\x07REQUEST\x10\x02\"\xfe\x01\n\x0bWiFiCommand\x12\x1f\n\x04type\x18\x01 \x01(\x0e\x32\x11.WiFiCommand.Type\x12\x0c\n\x04ssid\x18\x02 \x01(\t\x12\x0e\n\x06passwd\x18\x03 \x01(\t\x12\x0b\n\x03url\x18\x04 \x01(\t\x12\x0c\n\x04port\x18\x08 \x01(\r\x12\n\n\x02rc\x18\x05 \x01(\r\x12\n\n\x02ts\x18\x06 \x01(\r\x12\x0c\n\x04resp\x18\x07 \x01(\x0c\"o\n\x04Type\x12\x0b\n\x07\x43ONNECT\x10\x00\x12\x08\n\x04POST\x10\x01\x12\t\n\x05\x43HECK\x10\x02\x12\x08\n\x04TIME\x10\x03\x12\x0e\n\nDISCONNECT\x10\x04\x12\x0e\n\nCHECK_WIFI\x10\x05\x12\r\n\tCHECK_API\x10\x06\x12\x0c\n\x08NTP_SYNC\x10\x07\"\xdc\x02\n\x11UserConfiguration\x12\x11\n\tlogger_id\x18\x01 \x01(\r\x12\x0f\n\x07\x63\x65ll_id\x18\x02 \x01(\r\x12$\n\rUpload_method\x18\x03 \x01(\x0e\x32\r.Uploadmethod\x12\x17\n\x0fUpload_interval\x18\x04 \x01(\r\x12\'\n\x0f\x65nabled_sensors\x18\x05 \x03(\x0e\x32\x0e.EnabledSensor\x12\x15\n\rVoltage_Slope\x18\x06 \x01(\x01\x12\x16\n\x0eVoltage_Offset\x18\x07 \x01(\x01\x12\x15\n\rCurrent_Slope\x18\x08 \x01(\x01\x12\x16\n\x0e\x43urrent_Offset\x18\t \x01(\x01\x12\x11\n\tWiFi_SSID\x18\n \x01(\t\x12\x15\n\rWiFi_Password\x18\x0b \x01(\t\x12\x18\n\x10\x41PI_Endpoint_URL\x18\x0c \x01(\t\x12\x19\n\x11\x41PI_Endpoint_Port\x18\r \x01(\r*O\n\rEnabledSensor\x12\x0b\n\x07Voltage\x10\x00\x12\x0b\n\x07\x43urrent\x10\x01\x12\x0b\n\x07Teros12\x10\x02\x12\x0b\n\x07Teros21\x10\x03\x12\n\n\x06\x42ME280\x10\x04*\"\n\x0cUploadmethod\x12\x08\n\x04LoRa\x10\x00\x12\x08\n\x04WiFi\x10\x01\x62\x06proto3')
28
28
 
29
29
  _globals = globals()
30
30
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
31
31
  _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'soil_power_sensor_pb2', _globals)
32
32
  if not _descriptor._USE_C_DESCRIPTORS:
33
33
  DESCRIPTOR._loaded_options = None
34
- _globals['_ENABLEDSENSOR']._serialized_start=1790
35
- _globals['_ENABLEDSENSOR']._serialized_end=1869
36
- _globals['_UPLOADMETHOD']._serialized_start=1871
37
- _globals['_UPLOADMETHOD']._serialized_end=1905
34
+ _globals['_ENABLEDSENSOR']._serialized_start=1851
35
+ _globals['_ENABLEDSENSOR']._serialized_end=1930
36
+ _globals['_UPLOADMETHOD']._serialized_start=1932
37
+ _globals['_UPLOADMETHOD']._serialized_end=1966
38
38
  _globals['_MEASUREMENTMETADATA']._serialized_start=27
39
39
  _globals['_MEASUREMENTMETADATA']._serialized_end=96
40
40
  _globals['_POWERMEASUREMENT']._serialized_start=98
@@ -64,9 +64,9 @@ if not _descriptor._USE_C_DESCRIPTORS:
64
64
  _globals['_TESTCOMMAND_CHANGESTATE']._serialized_start=1181
65
65
  _globals['_TESTCOMMAND_CHANGESTATE']._serialized_end=1241
66
66
  _globals['_WIFICOMMAND']._serialized_start=1244
67
- _globals['_WIFICOMMAND']._serialized_end=1437
67
+ _globals['_WIFICOMMAND']._serialized_end=1498
68
68
  _globals['_WIFICOMMAND_TYPE']._serialized_start=1387
69
- _globals['_WIFICOMMAND_TYPE']._serialized_end=1437
70
- _globals['_USERCONFIGURATION']._serialized_start=1440
71
- _globals['_USERCONFIGURATION']._serialized_end=1788
69
+ _globals['_WIFICOMMAND_TYPE']._serialized_end=1498
70
+ _globals['_USERCONFIGURATION']._serialized_start=1501
71
+ _globals['_USERCONFIGURATION']._serialized_end=1849
72
72
  # @@protoc_insertion_point(module_scope)
@@ -120,8 +120,8 @@ class TestDecode(unittest.TestCase):
120
120
  self.assertEqual(123, meas_dict["data"]["ec"])
121
121
  self.assertEqual(int, meas_dict["data_type"]["ec"])
122
122
 
123
- def test_phytos31(self):
124
- """Test decoding of Phytos31 measurement"""
123
+ def test_bme280(self):
124
+ """Test decoding of bme280 measurement"""
125
125
 
126
126
  meas = Measurement()
127
127
  meas.meta.CopyFrom(self.meta)
@@ -208,6 +208,27 @@ class TestDecode(unittest.TestCase):
208
208
  with self.assertRaises(KeyError):
209
209
  decode_measurement(data=meas_str)
210
210
 
211
+ def test_missing_default_values(self):
212
+ """Test to ensure that default valued fields are included in the
213
+ decoded dictionary
214
+ """
215
+
216
+ meas = Measurement()
217
+ meas.meta.CopyFrom(self.meta)
218
+
219
+ meas.teros12.vwc_raw = 2141.52
220
+ meas.teros12.vwc_adj = 0.45
221
+ meas.teros12.temp = 25.0
222
+
223
+ # set integer to default value of 0
224
+ meas.teros12.ec = 0
225
+
226
+ meas_str = meas.SerializeToString()
227
+
228
+ meas_dict = decode_measurement(data=meas_str)
229
+
230
+ self.assertIn("ec", meas_dict["data"])
231
+
211
232
 
212
233
  class TestEsp32(unittest.TestCase):
213
234
  def test_cmd_not_implemented(self):
@@ -1,9 +0,0 @@
1
- matplotlib
2
- pandas
3
- pyserial
4
- tqdm
5
- scikit-learn
6
- rocketlogger
7
- pyyaml
8
- ents
9
- protobuf==4.25.5
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes