Skip to content

Commit e4e9706

Browse files
committed
- push version
- ensures correct profile hash computation on "Save As" (Issue #2205) - lib updates
1 parent a2ed9da commit e4e9706

69 files changed

Lines changed: 27517 additions & 27520 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/artisanlib/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
__version__ = '4.2.0'
1+
__version__ = '4.2.1'
22
__revision__ = ''
3-
__build__ = '1'
3+
__build__ = '0'
44
__artisan_os__ = 'Linux'
55

66
__release_sponsor_name__ = 'LABEL!ISTEN'
77
__release_sponsor_domain__ = 'labelisten.com'
88
__release_sponsor_url__ = 'https://labelisten.com/'
9-
__signature__ = '29f13f2dbeacd4b04901ccd9a8848c5160d74ecaefdaf4fa565347cfdd820eeac3f92392ccc847f5bb5f58c08ad39be16514a7279141913f0572664b21591b0c'
9+
__signature__ = '4857e858c31f5a78c45bbee1a8e3d89d7b177feacefe47052d5029d4f8fc6ff4f82829c4e6b04b9ee11e1602613b523a98e6bffe0581793afb50238dafeb1e08'

src/artisanlib/main.py

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7643,7 +7643,7 @@ def curveSimilarity(self) -> tuple[float|None, float|None]: # pylint: disable=no
76437643
try:
76447644
# we masked the -1 error values
76457645
np_etb_masked = numpy.ma.masked_equal(np_etb, -1)
7646-
np_timeB_etb_masked = numpy.ma.masked_array(np_timeB, np_etb_masked.mask) # type:ignore[operator,unused-ignore] # ty:ignore[call-non-callable] # pylint:disable=no-member
7646+
np_timeB_etb_masked = numpy.ma.masked_array(np_timeB, np_etb_masked.mask) # type:ignore[operator,unused-ignore] # pylint:disable=no-member
76477647
# ignore the masked error values on computing the interpolation and fill (especially on the left) with -1 values
76487648
interp_np_etb = numpy.interp(np_timex,np_timeB_etb_masked.compressed(),np_etb_masked.compressed(),left=-1,right=-1) # pyright:ignore[reportUnknownArgumentType] # pylint:disable=no-member
76497649

@@ -7668,7 +7668,7 @@ def curveSimilarity(self) -> tuple[float|None, float|None]: # pylint: disable=no
76687668
try:
76697669
# we masked the -1 error values
76707670
np_btb_masked = numpy.ma.masked_equal(np_btb, -1)
7671-
np_timeB_btb_masked = numpy.ma.masked_array(np_timeB, np_btb_masked.mask) # type:ignore[operator,unused-ignore] # ty:ignore[call-non-callable] # pylint:disable=no-member
7671+
np_timeB_btb_masked = numpy.ma.masked_array(np_timeB, np_btb_masked.mask) # type:ignore[operator,unused-ignore] pylint:disable=no-member
76727672
# ignore the masked error values on computing the interpolation and fill (especially on the left) with -1 values
76737673
interp_np_btb = numpy.interp(np_timex,np_timeB_btb_masked.compressed(),np_btb_masked.compressed(),left=-1,right=-1) # pyright:ignore[reportUnknownArgumentType] # pylint:disable=no-member
76747674

@@ -13350,12 +13350,7 @@ def automaticsave(self, interactive:bool = True) -> str|None:
1335013350
if res:
1335113351
#write
1335213352
pf = self.getProfile()
13353-
sync_record_hash = plus.controller.updateSyncRecordHashAndSync()
13354-
if sync_record_hash is not None:
13355-
# we add the hash over the sync record to be able to detect offline changes
13356-
hash_encoded = encodeLocal(sync_record_hash)
13357-
if hash_encoded is not None:
13358-
pf['plus_sync_record_hash'] = hash_encoded
13353+
# pf should not be modified before saving anymore this would break its hash
1335913354
self.plusAddPath(cast(dict[str, Any], pf), filename_path)
1336013355
serialize(filename_path, cast(dict[str, Any], pf))
1336113356
self.sendmessage(QApplication.translate('Message','Profile {0} saved in: {1}').format(filename,self.qmc.autosavepath))
@@ -17027,7 +17022,7 @@ def computedProfileInformation(self) -> 'ComputedProfileInformation':
1702717022

1702817023
#used by filesave()
1702917024
#wrap values in unicode(.) if and only if those are of type string
17030-
def getProfile(self) -> 'ProfileData':
17025+
def getProfile(self, copy:bool = False) -> 'ProfileData':
1703117026
try:
1703217027
profile = ProfileData()
1703317028
profile['recording_version'] = self.recording_version
@@ -17120,10 +17115,15 @@ def getProfile(self) -> 'ProfileData':
1712017115
profile['roastbatchnr'] = self.qmc.roastbatchnr
1712117116
profile['roastbatchprefix'] = encodeLocalStrict(self.qmc.roastbatchprefix)
1712217117
profile['roastbatchpos'] = self.qmc.roastbatchpos
17123-
if self.qmc.roastUUID is None:
17118+
if copy:
17119+
# if the copy flag is set, we generate a new roastUUID
1712417120
import uuid
17125-
self.qmc.roastUUID = uuid.uuid4().hex # generate UUID
17126-
profile['roastUUID'] = self.qmc.roastUUID
17121+
profile['roastUUID'] = uuid.uuid4().hex # generate UUID
17122+
else:
17123+
if self.qmc.roastUUID is None:
17124+
import uuid
17125+
self.qmc.roastUUID = uuid.uuid4().hex # generate UUID
17126+
profile['roastUUID'] = self.qmc.roastUUID
1712717127
if self.qmc.scheduleID is not None:
1712817128
profile['scheduleID'] = self.qmc.scheduleID
1712917129
if self.qmc.scheduleDate is not None:
@@ -17304,6 +17304,14 @@ def getProfile(self) -> 'ProfileData':
1730417304
_, _, exc_tb = sys.exc_info()
1730517305
self.qmc.adderror((QApplication.translate('Error Message', 'Exception:') + ' getProfile(): {0}').format(str(ex)),getattr(exc_tb, 'tb_lineno', '?'))
1730617306

17307+
# set sync_record_hash if any
17308+
sync_record_hash = plus.controller.updateSyncRecordHashAndSync()
17309+
if sync_record_hash is not None:
17310+
# we add the hash over the sync record to be able to detect offline changes
17311+
srh = encodeLocal(sync_record_hash)
17312+
if srh is not None:
17313+
profile['plus_sync_record_hash'] = srh
17314+
1730717315
# add hash
1730817316
import hashlib
1730917317
import json
@@ -17353,20 +17361,9 @@ def fileSave(self, fname:str|None, copy:bool = False) -> bool:
1735317361
filename = self.ArtisanSaveFileDialog(msg=QApplication.translate('Message', 'Save Profile'), path=fname)
1735417362
if filename:
1735517363
#write
17356-
pf = self.getProfile()
17364+
pf = self.getProfile(copy)
17365+
# pf should not be modified before saving anymore this would break its hash
1735717366
if pf:
17358-
# if the copy flag is set, we generate a new roastUUID
17359-
if copy:
17360-
import uuid
17361-
pf['roastUUID'] = uuid.uuid4().hex # generate UUID
17362-
17363-
sync_record_hash = plus.controller.updateSyncRecordHashAndSync()
17364-
if sync_record_hash is not None:
17365-
# we add the hash over the sync record to be able to detect offline changes
17366-
srh = encodeLocal(sync_record_hash)
17367-
if srh is not None:
17368-
pf['plus_sync_record_hash'] = srh
17369-
1737017367
# we save the file and set the filename
1737117368
self.plusAddPath(cast(dict[str,Any], pf), filename)
1737217369
serialize(filename, cast(dict[str,Any], pf))

src/artisanlib/roast_properties.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1364,7 +1364,7 @@ def __init__(self, parent:QWidget, aw:'ApplicationWindow', activeTab:int = 0, st
13641364
self.plus_amount_replace_selected:float|None = None # holds the max amount of the selected coffee/blend incl. replacements if known
13651365
plusCoffeeslabel = QLabel('<b>' + QApplication.translate('Label', 'Stock') + '</b>')
13661366
plusCoffeeslabel.setToolTip(QApplication.translate('Tooltip','Select beans from your inventory'))
1367-
self.plusStoreslabel = QLabel('<b>' + QApplication.translate('Label', 'Store') + '</b>')
1367+
self.plusStoreslabel = QLabel('<b>' + QApplication.translate('Label', 'Space') + '</b>')
13681368
self.plusStoreslabel.setToolTip(QApplication.translate('Tooltip','Select a storage location'))
13691369
self.plusBlendslabel = QLabel('<b>' + QApplication.translate('Label', 'Blend') + '</b>')
13701370
self.plusBlendslabel.setToolTip(QApplication.translate('Tooltip','Select a blend from your inventory'))

src/requirements-dev.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ pytest-datadir==1.8.0
2929
#PyVirtualDisplay==3.0
3030
#pytest-bdd==6.1.1
3131
#pytest-benchmark==4.0.0
32-
hypothesis>=6.155.7
33-
coverage>=7.14.3
32+
hypothesis>=6.156.1
33+
coverage>=7.15.0
3434
coverage-badge==1.1.2
3535
codespell==2.4.2
3636
# the following 2 packages are not installed along aiohttp on Python3.12 and make mypy complain

src/requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
######
2727
# packages that are required on all platforms
2828
#
29-
setuptools==82.0.1
29+
setuptools==81.0.0 # forced by numpy 25.1 (current would be 83.0.0)
3030
wheel==0.47.0
3131
pyserial==3.5
3232
pymodbus==3.13.1
@@ -44,7 +44,7 @@ websockets==16.0
4444
PyYAML==6.0.3
4545
psutil==7.2.2
4646
protobuf==7.35.1
47-
numpy==2.5.0
47+
numpy==2.5.1
4848
scipy==1.18.0
4949
wquantiles==0.6
5050
colorspacious==1.1.2
@@ -56,9 +56,9 @@ matplotlib==3.11.0
5656
jinja2==3.1.6
5757
aiohttp==3.14.1
5858
aiohttp_jinja2==1.6
59-
python-bidi==0.6.10
59+
python-bidi==0.6.11
6060
arabic-reshaper==3.0.1
61-
pillow==12.2.0
61+
pillow==12.3.0
6262
pydantic==2.13.4
6363
babel==2.18.0
6464
bleak==3.0.2

src/translations/artisan_ar.qm

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)