wizata-dsapi 2.2.0.dev7__py3-none-any.whl → 2.2.0.dev8__py3-none-any.whl

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.
wizata_dsapi/product.py CHANGED
@@ -7,7 +7,9 @@ ProductKind — what role a product plays: raw material, container, finished pro
7
7
 
8
8
  Product — something the plant consumes or makes, identified by a Wizata key
9
9
  (e.g. ``can_33_coke``). ``category`` is a backend category id (Volume, Count, ...):
10
- it says how a quantity of that product is expressed.
10
+ it says how a quantity of that product is expressed. ``unit`` (optional, DEV-6087) is
11
+ its default unit, a backend unit id of that category, used for stock totals across
12
+ storages; ``unit_symbol`` is filled on read only.
11
13
 
12
14
  ProductComponent — one line of a product's bill of materials: ``product`` is made of
13
15
  ``quantity`` ``unit`` of ``composed_of``. The unit is a backend unit id and must
@@ -120,12 +122,14 @@ class Product:
120
122
  return "planner/products"
121
123
 
122
124
  def __init__(self, key: str = None, name: str = None, category=None,
123
- kind: str = None, description: str = None):
125
+ kind: str = None, description: str = None, unit=None):
124
126
  self.key: Optional[str] = key
125
127
  self.name: Optional[str] = name
126
128
  self.category: Optional[str] = _uuid_str(category)
127
129
  self.kind: Optional[str] = kind
128
130
  self.description: Optional[str] = description
131
+ self.unit: Optional[str] = _uuid_str(unit)
132
+ self.unit_symbol: Optional[str] = None
129
133
  self.created_at: Optional[datetime] = None
130
134
  self.updated_at: Optional[datetime] = None
131
135
 
@@ -141,6 +145,10 @@ class Product:
141
145
  obj["kind"] = self.kind
142
146
  if self.description is not None:
143
147
  obj["description"] = self.description
148
+ if self.unit is not None:
149
+ obj["unit"] = self.unit
150
+ if self.unit_symbol is not None:
151
+ obj["unitSymbol"] = self.unit_symbol
144
152
  if self.created_at is not None:
145
153
  obj["createdAt"] = _ts_out(self.created_at)
146
154
  if self.updated_at is not None:
@@ -155,6 +163,8 @@ class Product:
155
163
  obj.category = _uuid_str(data.get("category"))
156
164
  obj.kind = data.get("kind")
157
165
  obj.description = data.get("description")
166
+ obj.unit = _uuid_str(data.get("unit"))
167
+ obj.unit_symbol = data.get("unitSymbol") or data.get("unit_symbol")
158
168
  obj.created_at = _ts_in(data.get("createdAt") or data.get("created_at"))
159
169
  obj.updated_at = _ts_in(data.get("updatedAt") or data.get("updated_at"))
160
170
  return obj
wizata_dsapi/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "2.2.0.dev7"
1
+ __version__ = "2.2.0.dev8"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wizata_dsapi
3
- Version: 2.2.0.dev7
3
+ Version: 2.2.0.dev8
4
4
  Summary: Wizata Data Science Toolkit
5
5
  Author: Wizata S.A.
6
6
  Author-email: info@wizata.com
@@ -34,7 +34,7 @@ wizata_dsapi/paged_query_result.py,sha256=QOpJMAS6rxJfiz3a5oSfc0gOvwQeZTEhOtBoSs
34
34
  wizata_dsapi/pipeline.py,sha256=mMkNzFQsC9s1ZuC0HrfLG1BsZCnYYlrrhPlo6Out1Zs,40872
35
35
  wizata_dsapi/pipeline_image.py,sha256=WtMY0_ncba9WzZ96KQINiYshJegQdArzhspKTGWBgVA,7758
36
36
  wizata_dsapi/plot.py,sha256=KLeYj6xpG_XFSDuR4A8Iqp2fmAVLeDsHaUOVT2sRUYM,4033
37
- wizata_dsapi/product.py,sha256=DEuqi-1KDih3fyLEmVlsKao57tCpPJQ2sTwhEqe-r0A,7577
37
+ wizata_dsapi/product.py,sha256=EiiT9icS2xr8aN3STre4X7CsaJ33tt7jmOnQPD9pA6U,8139
38
38
  wizata_dsapi/request.py,sha256=sjYNjxI6m88hdPIPOkRfwoFLNaV7cupjnLIktalapNI,29298
39
39
  wizata_dsapi/script.py,sha256=1Mjw3BNxN_R5dx0f55T0WuebqqRr_69rsK5yuQZOjmQ,19467
40
40
  wizata_dsapi/search.py,sha256=pHX-xGIB0E6gJkTxXmLjFe_b8-0gei7hfkW0JnxzCl0,4691
@@ -46,7 +46,7 @@ wizata_dsapi/trigger.py,sha256=waOX2AhrLvFzNFRQ535j6iemgg_QJP2QsWGL2ipljFg,8848
46
46
  wizata_dsapi/twin.py,sha256=8AnrxSaL7dMrILXJ3-GGmmUz078j3qqwzDTe6i86xqA,12672
47
47
  wizata_dsapi/twinregistration.py,sha256=iXt55AVGAQNl0jmxa3ZVynPqlSsIunFf4sLfp-MWTw0,13244
48
48
  wizata_dsapi/user.py,sha256=-hchKAMZULu9P00RUHDqu_5AT4NI5BYOJd8XCBrt3eQ,1950
49
- wizata_dsapi/version.py,sha256=yfwCYQz4p6IHiajShzB17V1HzG-JxgGk1JgH0R0YvRU,27
49
+ wizata_dsapi/version.py,sha256=dWjmgVO1N_7ZqUjw7TaWJ9Mf8q9u_v7Bblc1p43CEA0,27
50
50
  wizata_dsapi/wizard_function.py,sha256=RbM7W7Gf-6Rhp_1dU9DBYkHaciknGAGvuAndhAS_vyo,942
51
51
  wizata_dsapi/wizard_request.py,sha256=v6BaqKLKvTWmUSo0_gda9FabAQz5x_-GOH1Av50GzFo,3762
52
52
  wizata_dsapi/wizata_dsapi_client.py,sha256=O6Q-cFg0MYaLQqMR8VEMweTZ8fxDh5uuUJM5kavoeuw,121630
@@ -58,8 +58,8 @@ wizata_dsapi/plots/common.py,sha256=7F4WMBaddubnCpdSafgaI9U9Sz0Sngg0VREP_vnIMno,
58
58
  wizata_dsapi/plots/theme.py,sha256=D4sSgEwabXVxF3z1GV8DivXJbbY61KgxXAWfjUbNDAc,3594
59
59
  wizata_dsapi/scripts/__init__.py,sha256=9fRdTMuuXcqMkIsUPf5dwFsTWwBzKteQdAMVkyy2acQ,212
60
60
  wizata_dsapi/scripts/common.py,sha256=T2cP8aGPg8OgIvBWuQBNonVtph_dHlNFubByuYrLb0o,15675
61
- wizata_dsapi-2.2.0.dev7.dist-info/licenses/LICENSE.txt,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
62
- wizata_dsapi-2.2.0.dev7.dist-info/METADATA,sha256=uk069VouGwpiD3c4aQktZwzcILevlxIiFb3WElWMEGg,14037
63
- wizata_dsapi-2.2.0.dev7.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
64
- wizata_dsapi-2.2.0.dev7.dist-info/top_level.txt,sha256=-OeTJbEnh5DuWyTOHtvw0Dw3LRg3G27TNS6W4ZtfwPs,13
65
- wizata_dsapi-2.2.0.dev7.dist-info/RECORD,,
61
+ wizata_dsapi-2.2.0.dev8.dist-info/licenses/LICENSE.txt,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
62
+ wizata_dsapi-2.2.0.dev8.dist-info/METADATA,sha256=tzcckVsgwg1rEF-RN62m3HX2vhpNR6lJbEJ6dIwTZK4,14037
63
+ wizata_dsapi-2.2.0.dev8.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
64
+ wizata_dsapi-2.2.0.dev8.dist-info/top_level.txt,sha256=-OeTJbEnh5DuWyTOHtvw0Dw3LRg3G27TNS6W4ZtfwPs,13
65
+ wizata_dsapi-2.2.0.dev8.dist-info/RECORD,,