Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8373092
Fix inter-service communication patterns
forstmeier Jun 3, 2025
22a9c60
Update application/positionmanager/src/positionmanager/clients.py
chrisaddy Jun 3, 2025
2887ceb
Merge branch 'master' into 06-02-fix_inter-service_communication_patt…
chrisaddy Jun 3, 2025
00ffd1d
Integrate predictionengine into the workflows
forstmeier Jun 5, 2025
49b392f
Merge pull request #588 from pocketsizefund/06-04-integrate_predictio…
chrisaddy Jun 5, 2025
a1c7e64
Merge branch 'master' into 06-02-fix_inter-service_communication_patt…
chrisaddy Jun 5, 2025
b870adf
rebasing master
chrisaddy Jun 5, 2025
3b05fa4
Various fixes
forstmeier Jun 5, 2025
c329c4b
Add basic tests for datamanager
forstmeier Jun 5, 2025
3e4f77c
Merge pull request #590 from pocketsizefund/06-04-add_basic_tests_for…
chrisaddy Jun 6, 2025
8f42c14
Merge branch 'master' into 06-02-fix_inter-service_communication_patt…
forstmeier Jun 6, 2025
f872aae
Remove Flox environment variables to fix breaking tests
forstmeier Jun 6, 2025
dc37574
Merge branch 'master' into 06-02-fix_inter-service_communication_patt…
forstmeier Jun 6, 2025
14a6984
fix some linting issues
chrisaddy Jun 6, 2025
43af2da
Fix inter-service communication patterns
forstmeier Jun 3, 2025
0be3104
Integrate predictionengine into the workflows
forstmeier Jun 5, 2025
7a2cb67
fix some linting issues
chrisaddy Jun 6, 2025
3a43f98
fix linting
chrisaddy Jun 6, 2025
a75adf0
Fix inter-service communication patterns
forstmeier Jun 3, 2025
494b0a5
Integrate predictionengine into the workflows
forstmeier Jun 5, 2025
973ad6b
remove vars
chrisaddy Jun 6, 2025
19107c0
Merge pull request #591 from pocketsizefund/fix/linting
chrisaddy Jun 6, 2025
70739d6
Add linting fixes
forstmeier Jun 6, 2025
e0bbcb6
Fix CodeRabbit feedback
forstmeier Jun 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
"Bash(gh issue close:*)"
],
"deny": []
}
}
},
"enableAllProjectMcpServers": false
Comment thread
chrisaddy marked this conversation as resolved.
}
Comment thread
chrisaddy marked this conversation as resolved.
123 changes: 0 additions & 123 deletions .flox/env/manifest.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
"pulumi-python": {
"pkg-path": "pulumiPackages.pulumi-python"
},
"pulumictl": {
"pkg-path": "pulumictl"
},
"ruff": {
"pkg-path": "ruff"
},
Expand Down Expand Up @@ -398,126 +395,6 @@
"group": "toplevel",
"priority": 5
},
{
"attr_path": "pulumictl",
"broken": false,
"derivation": "/nix/store/kx43jzcfslw28byvs6h5ngsgl432pvvv-pulumictl-0.0.49.drv",
"description": "Swiss Army Knife for Pulumi Development",
"install_id": "pulumictl",
"license": "Apache-2.0",
"locked_url": "https://github.com/flox/nixpkgs?rev=979daf34c8cacebcd917d540070b52a3c2b9b16e",
"name": "pulumictl-0.0.49",
"pname": "pulumictl",
"rev": "979daf34c8cacebcd917d540070b52a3c2b9b16e",
"rev_count": 793735,
"rev_date": "2025-05-04T03:14:55Z",
"scrape_date": "2025-05-05T04:19:37.687142Z",
"stabilities": [
"staging",
"unstable"
],
"unfree": false,
"version": "0.0.49",
"outputs_to_install": [
"out"
],
"outputs": {
"out": "/nix/store/ny69c9bfkf4w179240ch45injfb2ajqr-pulumictl-0.0.49"
},
"system": "aarch64-darwin",
"group": "toplevel",
"priority": 5
},
{
"attr_path": "pulumictl",
"broken": false,
"derivation": "/nix/store/www9nfncvv7l339n8dks22x5vs5lz1mk-pulumictl-0.0.49.drv",
"description": "Swiss Army Knife for Pulumi Development",
"install_id": "pulumictl",
"license": "Apache-2.0",
"locked_url": "https://github.com/flox/nixpkgs?rev=979daf34c8cacebcd917d540070b52a3c2b9b16e",
"name": "pulumictl-0.0.49",
"pname": "pulumictl",
"rev": "979daf34c8cacebcd917d540070b52a3c2b9b16e",
"rev_count": 793735,
"rev_date": "2025-05-04T03:14:55Z",
"scrape_date": "2025-05-05T04:37:42.118866Z",
"stabilities": [
"staging",
"unstable"
],
"unfree": false,
"version": "0.0.49",
"outputs_to_install": [
"out"
],
"outputs": {
"out": "/nix/store/xpdh5dijdki4cngh7k7n4rg84i6c28zs-pulumictl-0.0.49"
},
"system": "aarch64-linux",
"group": "toplevel",
"priority": 5
},
{
"attr_path": "pulumictl",
"broken": false,
"derivation": "/nix/store/17wf5x1kk3v5ch5npwhamnix629y07wg-pulumictl-0.0.49.drv",
"description": "Swiss Army Knife for Pulumi Development",
"install_id": "pulumictl",
"license": "Apache-2.0",
"locked_url": "https://github.com/flox/nixpkgs?rev=979daf34c8cacebcd917d540070b52a3c2b9b16e",
"name": "pulumictl-0.0.49",
"pname": "pulumictl",
"rev": "979daf34c8cacebcd917d540070b52a3c2b9b16e",
"rev_count": 793735,
"rev_date": "2025-05-04T03:14:55Z",
"scrape_date": "2025-05-05T04:54:38.447587Z",
"stabilities": [
"staging",
"unstable"
],
"unfree": false,
"version": "0.0.49",
"outputs_to_install": [
"out"
],
"outputs": {
"out": "/nix/store/6wmig1w7f3vmfrlyg2qzv21bvacj3as8-pulumictl-0.0.49"
},
"system": "x86_64-darwin",
"group": "toplevel",
"priority": 5
},
{
"attr_path": "pulumictl",
"broken": false,
"derivation": "/nix/store/ib7hqxg7xdf5kyh78jqggzdcs97q1224-pulumictl-0.0.49.drv",
"description": "Swiss Army Knife for Pulumi Development",
"install_id": "pulumictl",
"license": "Apache-2.0",
"locked_url": "https://github.com/flox/nixpkgs?rev=979daf34c8cacebcd917d540070b52a3c2b9b16e",
"name": "pulumictl-0.0.49",
"pname": "pulumictl",
"rev": "979daf34c8cacebcd917d540070b52a3c2b9b16e",
"rev_count": 793735,
"rev_date": "2025-05-04T03:14:55Z",
"scrape_date": "2025-05-05T05:16:19.858098Z",
"stabilities": [
"staging",
"unstable"
],
"unfree": false,
"version": "0.0.49",
"outputs_to_install": [
"out"
],
"outputs": {
"out": "/nix/store/rmh9mjkxijxcc7cvjhsqc9657fbw0yyg-pulumictl-0.0.49"
},
"system": "x86_64-linux",
"group": "toplevel",
"priority": 5
},
{
"attr_path": "ruff",
"broken": false,
Expand Down
27 changes: 16 additions & 11 deletions application/positionmanager/src/positionmanager/clients.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import requests
import polars as pl
from typing import Dict, Any
import pyarrow as pa
Comment thread
forstmeier marked this conversation as resolved.

from alpaca.trading.client import TradingClient
from alpaca.trading.requests import MarketOrderRequest
Expand Down Expand Up @@ -71,30 +72,34 @@ def get_data(

endpoint = f"{self.datamanager_base_url}/equity-bars"

params = {
"start_date": date_range.start.date().isoformat(),
"end_date": date_range.end.date().isoformat(),
}

try:
response = requests.post(endpoint, json=date_range.to_payload(), timeout=10)
response = requests.get(endpoint, params=params, timeout=30)
except requests.RequestException as err:
raise RuntimeError(f"Data manager service call error: {err}") from err

if response.status_code != 200:
if response.status_code == 404:
return pl.DataFrame()
elif response.status_code != 200:
raise Exception(
f"Data service error: {response.text}, status code: {response.status_code}",
)
Comment thread
chrisaddy marked this conversation as resolved.
Outdated

response_data = response.json()
buffer = pa.py_buffer(response.content)
reader = pa.ipc.RecordBatchStreamReader(buffer)
table = reader.read_all()

data = pl.DataFrame(response_data["data"])
data = pl.DataFrame(pl.from_arrow(table))
Comment thread
forstmeier marked this conversation as resolved.

data = data.with_columns(
pl.col("timestamp")
.str.slice(0, 10)
.str.strptime(pl.Date, "%Y-%m-%d")
.alias("date")
)
data = data.with_columns(pl.col("t").cast(pl.Datetime).dt.date().alias("date"))
Comment thread
forstmeier marked this conversation as resolved.
Outdated

data = (
data.sort("date")
.pivot(on="ticker", index="date", values="close_price")
.pivot(on="T", index="date", values="c")
Comment thread
chrisaddy marked this conversation as resolved.
Outdated
.with_columns(pl.all().exclude("date").cast(pl.Float64))
)

Expand Down