Skip to content

Commit

Permalink
merge to master
Browse files Browse the repository at this point in the history
  • Loading branch information
abrichr committed Sep 11, 2024
2 parents 4b9582e + 1476966 commit dd1be17
Show file tree
Hide file tree
Showing 10 changed files with 309 additions and 286 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/release-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
poetry run python -m openadapt.build
cd dist
zip -r ../OpenAdapt.app.zip OpenAdapt.app
mv OpenAdapt.dmg ..
cd ..
- name: Upload MacOS executable
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -93,6 +94,7 @@ jobs:
poetry run python -m openadapt.build
cd dist
7z a -tzip ../OpenAdapt.zip OpenAdapt
move OpenAdapt_Installer.exe ..
cd ..
- name: Upload Windows executable
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -200,6 +202,16 @@ jobs:
with:
name: OpenAdapt
path: dist/
- name: Download macOS installer
uses: actions/download-artifact@v4
with:
name: OpenAdapt.dmg
path: dist/
- name: Download Windows installer
uses: actions/download-artifact@v4
with:
name: OpenAdapt_Installer
path: dist/
- name: Python Semantic Release
id: semantic_release
uses: python-semantic-release/[email protected]
Expand Down
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,52 @@



## v0.39.3 (2024-08-07)

### Fix

* fix: remove duplicate import (#870) ([`e776ed8`](https://github.com/OpenAdaptAI/OpenAdapt/commit/e776ed88dddd1eeaf773bd2dca5a0aea27da46ce))

* fix: only import window if necessary (#869)

Only import window if necessary ([`efc941d`](https://github.com/OpenAdaptAI/OpenAdapt/commit/efc941d34a4cabc7178112d5ca707fb6b956af52))


## v0.39.2 (2024-08-06)

### Fix

* fix(video): upgrade to pyav 12.3.0 (#868)

Fixes #862 ([`d7f463c`](https://github.com/OpenAdaptAI/OpenAdapt/commit/d7f463c7a17006162248007262515cd6c28b3e38))


## v0.39.1 (2024-07-25)

### Fix

* fix(installer): fix installer upload (#866)

* Update release-and-publish.yml: upload installers

* Update release-and-publish.yml: fix case ([`489b9c2`](https://github.com/OpenAdaptAI/OpenAdapt/commit/489b9c201d318fba09320b3c3e414ee1713ccafc))

* fix(VisualReplayStrategy): avoid re-using failing segmentations ([`0045ebb`](https://github.com/OpenAdaptAI/OpenAdapt/commit/0045ebb1f98cc74983ab1265266aed870ff54d7d))

* fix(installer, audio): postinstall whisper; download installer artefacts (#865)

* postinstall whisper; download installer artefacts

* poetry lock ([`a4470c3`](https://github.com/OpenAdaptAI/OpenAdapt/commit/a4470c372417cb0a22ee1a44193b6f23de44d96e))


## v0.39.0 (2024-07-25)

### Feature

* feat(installer): upload installers (#863) ([`47fa551`](https://github.com/OpenAdaptAI/OpenAdapt/commit/47fa551b204c749f6649815bcf01def9d06257c3))


## v0.38.0 (2024-07-25)

### Feature
Expand Down
4 changes: 3 additions & 1 deletion build_scripts/upload_release_artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ poetry install
VERSION="v$(poetry run python -m build_scripts.get_version)"
mv dist/OpenAdapt.zip dist/OpenAdapt-$VERSION.zip
mv dist/OpenAdapt.app.zip dist/OpenAdapt-$VERSION.app.zip
mv dist/OpenAdapt_Installer.exe dist/OpenAdapt_Installer-$VERSION.exe
mv dist/OpenAdapt.dmg dist/OpenAdapt-$VERSION.dmg
echo "Uploading release artifacts for version $VERSION"
gh release upload $VERSION dist/OpenAdapt-$VERSION.zip dist/OpenAdapt-$VERSION.app.zip
gh release upload $VERSION dist/OpenAdapt-$VERSION.zip dist/OpenAdapt-$VERSION.app.zip dist/OpenAdapt_Installer-$VERSION.exe dist/OpenAdapt-$VERSION.dmg
3 changes: 3 additions & 0 deletions openadapt/drivers/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ def get_response(
if "error" in result:
error = result["error"]
message = error["message"]
logger.warning(f"{message=}")
if "retry" in message:
return get_response(payload)
raise Exception(message)
return result

Expand Down
3 changes: 2 additions & 1 deletion openadapt/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import numpy as np
import sqlalchemy as sa

from openadapt import window
from openadapt.config import config
from openadapt.custom_logger import logger
from openadapt.db import db
Expand Down Expand Up @@ -539,6 +538,8 @@ def get_active_window_event(
Returns:
(WindowEvent) the active window event.
"""
from openadapt import window

return WindowEvent(**window.get_active_window_data(include_window_data))

def scrub(self, scrubber: ScrubbingProvider | TextScrubbingMixin) -> None:
Expand Down
17 changes: 9 additions & 8 deletions openadapt/strategies/visual.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,14 +391,15 @@ def get_window_segmentation(
if DEBUG:
original_image.show()

similar_segmentation, similar_segmentation_diff = find_similar_image_segmentation(
original_image,
)
if similar_segmentation:
# TODO XXX: create copy of similar_segmentation, but overwrite with segments of
# regions of new image where segments of similar_segmentation overlap non-zero
# regions of similar_segmentation_diff
return similar_segmentation
if not exceptions:
similar_segmentation, similar_segmentation_diff = (
find_similar_image_segmentation(original_image)
)
if similar_segmentation:
# TODO XXX: create copy of similar_segmentation, but overwrite with segments
# of regions of new image where segments of similar_segmentation overlap
# non-zero regions of similar_segmentation_diff
return similar_segmentation

segmentation_adapter = adapters.get_default_segmentation_adapter()
segmented_image = segmentation_adapter.fetch_segmented_image(original_image)
Expand Down
7 changes: 5 additions & 2 deletions openadapt/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,10 @@ def parse_code_snippet(snippet: str) -> dict:
"""
code_block = extract_code_block(snippet)
# remove backtick lines
code_content = "\n".join(code_block.splitlines()[1:-1])
if "```" in code_block:
code_content = "\n".join(code_block.splitlines()[1:-1])
else:
code_content = code_block
# convert literals from Javascript to Python
to_by_from = {
"true": "True",
Expand Down Expand Up @@ -637,7 +640,7 @@ def extract_code_block(text: str) -> str:
raise ValueError("Uneven number of backtick lines")

if len(backtick_idxs) < 2:
return "" # No enclosing backticks found, return empty string
return text

# Extract only the lines between the first and last backtick line,
# including the backticks
Expand Down
Loading

0 comments on commit dd1be17

Please sign in to comment.