Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
A
alpha-mind
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dr.李
alpha-mind
Commits
552b014c
Commit
552b014c
authored
Sep 22, 2017
by
Dr.李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added some code for naive executor
parent
7048ef8d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
1 deletion
+26
-1
test_naiveexecutor.py
alphamind/tests/execution/test_naiveexecutor.py
+23
-0
test_thresholdexecutor.py
alphamind/tests/execution/test_thresholdexecutor.py
+1
-1
test_suite.py
alphamind/tests/test_suite.py
+2
-0
No files found.
alphamind/tests/execution/test_naiveexecutor.py
0 → 100644
View file @
552b014c
# -*- coding: utf-8 -*-
"""
Created on 2017-9-22
@author: cheng.li
"""
import
unittest
import
pandas
as
pd
from
alphamind.execution.naiveexecutor
import
NaiveExecutor
class
TestNaiveExecutor
(
unittest
.
TestCase
):
@
staticmethod
def
test_naive_executor
():
target_pos
=
pd
.
DataFrame
({
'code'
:
[
1
,
2
,
3
],
'weight'
:
[
0.2
,
0.3
,
0.5
],
'industry'
:
[
'a'
,
'b'
,
'c'
]})
executor
=
NaiveExecutor
()
turn_over
,
executed_pos
=
executor
.
execute
(
target_pos
)
alphamind/tests/execution/test_thresholdexecutor.py
View file @
552b014c
...
@@ -12,8 +12,8 @@ from alphamind.execution.thresholdexecutor import ThresholdExecutor
...
@@ -12,8 +12,8 @@ from alphamind.execution.thresholdexecutor import ThresholdExecutor
class
TestThresholdExecutor
(
unittest
.
TestCase
):
class
TestThresholdExecutor
(
unittest
.
TestCase
):
@
staticmethod
def
test_threshold_executor
(
self
):
def
test_threshold_executor
(
self
):
target_pos
=
pd
.
DataFrame
({
'code'
:
[
1
,
2
,
3
],
target_pos
=
pd
.
DataFrame
({
'code'
:
[
1
,
2
,
3
],
'weight'
:
[
0.2
,
0.3
,
0.5
],
'weight'
:
[
0.2
,
0.3
,
0.5
],
'industry'
:
[
'a'
,
'b'
,
'c'
]})
'industry'
:
[
'a'
,
'b'
,
'c'
]})
...
...
alphamind/tests/test_suite.py
View file @
552b014c
...
@@ -28,6 +28,7 @@ from alphamind.tests.analysis.test_factoranalysis import TestFactorAnalysis
...
@@ -28,6 +28,7 @@ from alphamind.tests.analysis.test_factoranalysis import TestFactorAnalysis
from
alphamind.tests.analysis.test_quantilieanalysis
import
TestQuantileAnalysis
from
alphamind.tests.analysis.test_quantilieanalysis
import
TestQuantileAnalysis
from
alphamind.tests.model.test_linearmodel
import
TestLinearModel
from
alphamind.tests.model.test_linearmodel
import
TestLinearModel
from
alphamind.tests.model.test_loader
import
TestLoader
from
alphamind.tests.model.test_loader
import
TestLoader
from
alphamind.tests.execution.test_naiveexecutor
import
TestNaiveExecutor
from
alphamind.tests.execution.test_thresholdexecutor
import
TestThresholdExecutor
from
alphamind.tests.execution.test_thresholdexecutor
import
TestThresholdExecutor
...
@@ -49,6 +50,7 @@ if __name__ == '__main__':
...
@@ -49,6 +50,7 @@ if __name__ == '__main__':
TestQuantileAnalysis
,
TestQuantileAnalysis
,
TestLinearModel
,
TestLinearModel
,
TestLoader
,
TestLoader
,
TestNaiveExecutor
,
TestThresholdExecutor
],
TestThresholdExecutor
],
alpha_logger
)
alpha_logger
)
runner
.
run
()
runner
.
run
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment