Skip to content

Commit

Permalink
revert bad rebase
Browse files Browse the repository at this point in the history
Revert "fix fake /api/returns endpoint"

This reverts commit ba40f19.

Revert "use test constructor and remove Values encoding/decoding"

This reverts commit b06335c.

Revert "fix tests after rebase"

This reverts commit a8ac963.

Revert "use Component for factor list"

This reverts commit 9f99a63.

Revert "test: change in AddColumn behavior"

This reverts commit d603d91.

Revert "simplify implementation of AddColumn"

This reverts commit f3120c0.

Revert "add label field to Component"

This reverts commit 1cfe9ac.

Revert "do not marshal nil table fields"

This reverts commit d333eff.

Revert "add table method "ClosestTimeOnOrBefore""

This reverts commit 7f78422.

Revert "fix test setup"

This reverts commit 8a1cc7f.

Revert "add factors to Metadata"

This reverts commit dda7931.

Revert "fix lookback function when window is empty"

This reverts commit bf5d94f.

Revert "move weights len check to alg implementation"

This reverts commit 81858db.

Revert "add allocation package"

This reverts commit 04e0e87.
  • Loading branch information
crhntr committed Dec 25, 2023
1 parent ba40f19 commit 12830d4
Show file tree
Hide file tree
Showing 23 changed files with 360 additions and 643 deletions.
29 changes: 0 additions & 29 deletions allocation/constant.go

This file was deleted.

21 changes: 0 additions & 21 deletions allocation/equal.go

This file was deleted.

42 changes: 0 additions & 42 deletions allocation/functions.go

This file was deleted.

44 changes: 0 additions & 44 deletions allocation/inverse_variance.go

This file was deleted.

95 changes: 0 additions & 95 deletions allocation/optimizer_internal.go

This file was deleted.

46 changes: 0 additions & 46 deletions allocation/risk.go

This file was deleted.

75 changes: 0 additions & 75 deletions allocation/volatility.go

This file was deleted.

18 changes: 0 additions & 18 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import (
"os"
"strings"

"go.mongodb.org/mongo-driver/bson/primitive"

"github.com/portfoliotree/portfolio/returns"
)

Expand Down Expand Up @@ -59,22 +57,6 @@ func (pf *Specification) AssetReturns(ctx context.Context) (returns.Table, error
return doJSONRequest[returns.Table](http.DefaultClient.Do, req)
}

func ParseComponentsFromURL(values url.Values, prefix string) ([]Component, error) {
assetValues, ok := values[prefix+"-id"]
if !ok {
return nil, errors.New("use asset-id parameters to specify asset returns")
}
components := make([]Component, 0, len(assetValues))
for _, v := range assetValues {
if _, err := primitive.ObjectIDFromHex(v); err == nil {
components = append(components, Component{Type: "Portfolio", ID: v})
continue
}
components = append(components, Component{Type: "Security", ID: v})
}
return components, nil
}

func doJSONRequest[T any](do func(r *http.Request) (*http.Response, error), req *http.Request) (T, error) {
var result T
req.Header.Set("accept", "application/json")
Expand Down
Loading

0 comments on commit 12830d4

Please sign in to comment.