Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/35 multiple portfolios #96

Merged
merged 7 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .github/workflows/build-Docker-image-triggers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
- default_2023Q4
- full_params_2022Q4
- full_params_2023Q4
- multiple_portfolio_files
with:
full-image-name: ${{ needs.docker.outputs.full-image-name }}
config-name: ${{ matrix.config-name }}
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: workflow.pacta
Title: Run PACTA
Version: 0.0.0.9010
Version: 0.0.0.9011
Authors@R:
c(person(given = "CJ",
family = "Yetman",
Expand Down
10 changes: 8 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
---
services:
workflow.pacta:
build: .
# build: .
image: ghcr.io/rmi-pacta/workflow.pacta:pr-96
# stdin_open: true
# tty: true
# entrypoint: ["R", "--args"]
command: '{\"portfolio\": {\"files\": \"default_portfolio.csv\", \"holdingsDate\": \"2023-12-31\"}, \"inherit\": \"2023Q4\"}'
command: '/test_params.json'
# command: '{\"portfolio\": {\"files\": [\"default_portfolio.csv\"], \"holdingsDate\": \"2023-12-31\"}, \"inherit\": \"2023Q4\"}'
environment:
LOG_LEVEL: TRACE
PACTA_DATA_DIR: "/mnt/pacta-data"
Expand All @@ -24,3 +26,7 @@ services:
source: ${input_dir:-./portfolios}
target: /mnt/portfolios
read_only: true
- type: bind
source: ./portfolios/default_params.json
target: /test_params.json
read_only: true
8 changes: 6 additions & 2 deletions inst/extdata/schema/portfolio.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
"type": "object",
"properties": {
"files": {
"type": "string",
"description": "List of portfolio files to be analyzed."
"type": "array",
"description": "List of portfolio files to be analyzed.",
"items": {
"type": "string",
"description": "Path to the file."
}
},
"holdingsDate": {
"type": "string",
Expand Down
38 changes: 38 additions & 0 deletions portfolios/default_params.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"portfolio": {
"holdingsDate": "2023-12-31",
"files":
[
"default_portfolio.csv"
],
"name": "Default Portfolio"
},
"analysis": {
"equityMarketList": [
"GlobalMarket",
"DevelopedMarket",
"EmergingMarket"
],
"scenarioGeographiesList": [
"Global",
"GlobalAggregate",
"NonOECD",
"OECD"
],
"scenarioSourcesList": [
"GECO2023",
"ISF2023",
"WEO2023"
],
"sectorList": [
"Power",
"Automotive",
"Coal",
"Steel",
"Aviation",
"Cement"
],
"startYear": 2022,
"timeHorizon": 5
}
}
39 changes: 39 additions & 0 deletions portfolios/multiple_files.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"portfolio": {
"holdingsDate": "2023-12-31",
"files":
[
"section_1.csv",
"section_2.csv"
],
"name": "Default Portfolio"
},
"analysis": {
"equityMarketList": [
"GlobalMarket",
"DevelopedMarket",
"EmergingMarket"
],
"scenarioGeographiesList": [
"Global",
"GlobalAggregate",
"NonOECD",
"OECD"
],
"scenarioSourcesList": [
"GECO2023",
"ISF2023",
"WEO2023"
],
"sectorList": [
"Power",
"Automotive",
"Coal",
"Steel",
"Aviation",
"Cement"
],
"startYear": 2022,
"timeHorizon": 5
}
}
46 changes: 46 additions & 0 deletions portfolios/section_1.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
isin,market_value,currency
XS1297557172,6821206,USD
DE000A1R07L4,4724723,USD
US345370BV11,5619252,USD
CND10001QD60,1124438,USD
XS2356040357,3076756,USD
US31428XAY22,8235607,USD
FR0012650281,641235,USD
FR001400F2Q0,4190307,USD
USQ94606AE22,4118654,USD
US911312BB15,5414864,USD
INE331A07273,2972779,USD
INE481G07166,3244497,USD
INE010A08065,4488737,USD
US86614RAF47,5793655,USD
FR0124261621,1581767,USD
US60937CAA36,900439,USD
US93317QAD79,9993273,USD
TH0148034703,8657460,USD
XS2325566847,9459870,USD
US02076XAC65,3952496,USD
US880779BA01,3506143,USD
USU88125AC04,3401211,USD
INE208A07281,8670483,USD
US69373UAA51,267878,USD
US12594KAA07,4094599,USD
US205677AB38,3309593,USD
US69370RAK32,3519158,USD
US707887A@47,1577541,USD
US166764AA86,6575752,USD
US71654QCP54,7084677,USD
INE206D08162,6210214,USD
US745310AB85,709698,USD
CA44882ZXZ12,2809584,USD
JP360540AR10,9641731,USD
CA44885ZEQ96,9683822,USD
INE017A08235,3910673,USD
XS1555576641,2598631,USD
XS1381693248,2117715,USD
NO0010892870,8899756,USD
NO0010806912,7280862,USD
USU85795AQ29,2560264,USD
JP338603AA35,6806168,USD
DE000A2GESQ1,1567613,USD
INE114A07802,8605761,USD
US03938LAA26,2698943,USD
46 changes: 46 additions & 0 deletions portfolios/section_2.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
isin,market_value,currency
KR7005380001,9338795,USD
CNE100000Q35,1068423,USD
KYG3777B1032,9637388,USD
US5787871038,5467105,USD
SE0016844831,4168401,USD
TW0002646007,6371201,USD
INE646L01027,8355228,USD
US38045R2067,7952384,USD
PHY1234G1032,180886,USD
US00910M1009,6809079,USD
INE070A01015,1013567,USD
CNE000000XV4,8873793,USD
PK0059501012,5829360,USD
INE583C01021,6059486,USD
MYL5000OO004,6433976,USD
AU000000BCB5,9186193,USD
US03940R1077,265189,USD
ID1000162902,1712519,USD
US03485P3001,4712749,USD
CNE0000017V2,5989615,USD
NL0010545661,3343735,USD
CNE000000FH0,8915246,USD
US6937181088,9800223,USD
US9288541082,7226287,USD
CA62910L1022,9449577,USD
IL0011419699,7746343,USD
SE0020180917,1788562,USD
AU000000BUY9,1578448,USD
KR7096770003,860209,USD
US45325E2019,4071578,USD
CA45790B7088,8510107,USD
US0188021085,7030638,USD
JP3981200003,344741,USD
GB00B1VNSX38,6493591,USD
BRENGICDAM16,9257903,USD
MHY271836006,1571628,USD
MHY2687W1241,2627572,USD
TH0363010R10,8711798,USD
JP3247600004,4447848,USD
IL0065100930,1121308,USD
QA000A0KD6K3,6405719,USD
US92023R4074,8204370,USD
JP3342000001,8564047,USD
US88031M1099,149263,USD
TW0009957001,4538558,USD
4 changes: 3 additions & 1 deletion tests/config/default_2022Q4.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"pactaDataURL": "https://pactadatadev.file.core.windows.net/workflow-data-preparation-outputs/2022Q4_20240426T113151Z",
"parameters": {
"portfolio": {
"files": "default_portfolio.csv",
"files": [
"default_portfolio.csv"
],
"holdingsDate": "2023-12-31"
},
"inherit": "2022Q4"
Expand Down
4 changes: 3 additions & 1 deletion tests/config/default_2023Q4.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"pactaDataURL": "https://pactadatadev.file.core.windows.net/workflow-data-preparation-outputs/2023Q4_20240424T120055Z",
"parameters": {
"portfolio": {
"files": "default_portfolio.csv",
"files": [
"default_portfolio.csv"
],
"holdingsDate": "2023-12-31"
},
"inherit": "2023Q4"
Expand Down
4 changes: 3 additions & 1 deletion tests/config/full_params_2022Q4.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"parameters": {
"portfolio": {
"holdingsDate": "2022-12-31",
"files": "default_portfolio.csv",
"files": [
"default_portfolio.csv"
],
"name": "Default Portfolio"
},
"analysis": {
Expand Down
4 changes: 3 additions & 1 deletion tests/config/full_params_2023Q4.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"parameters": {
"portfolio": {
"holdingsDate": "2023-12-31",
"files": "default_portfolio.csv",
"files": [
"default_portfolio.csv"
],
"name": "Default Portfolio"
},
"analysis": {
Expand Down
14 changes: 14 additions & 0 deletions tests/config/multiple_portfolio_files.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"holdingsDate": "2023Q4",
"pactaDataURL": "https://pactadatadev.file.core.windows.net/workflow-data-preparation-outputs/2023Q4_20240424T120055Z",
"parameters": {
"portfolio": {
"files": [
"section_1.csv",
"section_2.csv"
],
"holdingsDate": "2023-12-31"
},
"inherit": "2023Q4"
}
}
Loading