mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-24 05:28:05 +00:00
test_python
This commit is contained in:
@@ -1,6 +1,12 @@
|
|||||||
name: Stage/build/test/release/publish
|
name: Stage/build/test/release/publish
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '*'
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- '*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_test:
|
build_test:
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
pytz>=2022
|
|
||||||
six>=1
|
|
||||||
python-dateutil>=2
|
|
||||||
numpy>=1.24
|
|
||||||
pandas>=1.5
|
|
||||||
pandas-ta>=0.3
|
|
||||||
@@ -22,31 +22,21 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
dotnet-version: |
|
dotnet-version: |
|
||||||
7.0.x
|
7.0.x
|
||||||
5.0.x
|
|
||||||
include-prerelease: true
|
include-prerelease: true
|
||||||
|
|
||||||
- name: Install Python
|
- name: Install Python
|
||||||
- uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.10'
|
||||||
check-latest: true
|
check-latest: false
|
||||||
cache: 'pip'
|
cache: 'pip'
|
||||||
cache-dependency-path: '**/requirements.txt'
|
cache-dependency-path: '\a\QuanTAlib\QuanTAlib\Tests\requirements.txt'
|
||||||
- run: pip install -r worklflows/requirements.txt
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pip install -r '\a\QuanTAlib\QuanTAlib\Tests\requirements.txt'
|
||||||
|
|
||||||
|
- name: path
|
||||||
|
run: '$env:path -split ";"'
|
||||||
|
|
||||||
- name: Install JDK11 for Sonar Scanner
|
|
||||||
uses: actions/setup-java@v1
|
|
||||||
with:
|
|
||||||
java-version: 1.11
|
|
||||||
|
|
||||||
- name: Install GitVersion
|
|
||||||
run: dotnet tool install GitVersion.Tool --global
|
|
||||||
- name: Install JetBrains
|
|
||||||
run: dotnet tool install JetBrains.dotCover.GlobalTool --global
|
|
||||||
- name: Install Sonar Scanner
|
|
||||||
run: dotnet tool install dotnet-sonarscanner --global
|
|
||||||
- name: Install dotnet-coverage
|
|
||||||
run: dotnet tool install dotnet-coverage --global
|
|
||||||
- name: Install CodeCov
|
|
||||||
run: dotnet tool install --global Codecov.Tool
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@
|
|||||||
<Platforms>AnyCPU;x64</Platforms>
|
<Platforms>AnyCPU;x64</Platforms>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Python.Included" Version="3.11.1" />
|
<PackageReference Include="Python.Included" Version="3.10.0-preview5" />
|
||||||
<PackageReference Include="pythonnet" Version="3.0.1" />
|
<PackageReference Include="pythonnet" Version="3.0.1" />
|
||||||
<PackageReference Include="xunit" Version="2.4.2" />
|
<PackageReference Include="xunit" Version="2.4.2" />
|
||||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
|
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
|
||||||
|
|||||||
@@ -25,13 +25,16 @@ public class PandasTA : IDisposable
|
|||||||
|
|
||||||
Installer.InstallPath = Path.GetFullPath(path: ".");
|
Installer.InstallPath = Path.GetFullPath(path: ".");
|
||||||
Installer.SetupPython().Wait();
|
Installer.SetupPython().Wait();
|
||||||
Installer.TryInstallPip().Wait();
|
Installer.TryInstallPip();
|
||||||
Installer.PipInstallModule(module_name: "numpy").Wait();
|
Installer.PipInstallModule(module_name: "numpy");
|
||||||
Installer.PipInstallModule(module_name: "pandas").Wait();
|
Installer.PipInstallModule(module_name: "pandas");
|
||||||
Installer.PipInstallModule(module_name: "pandas-ta").Wait();
|
Installer.PipInstallModule(module_name: "pandas-ta");
|
||||||
dllpath = Installer.InstallPath + "\\" + Installer.InstallDirectory + "\\" + Runtime.PythonDLL;
|
dllpath = Installer.InstallPath + "\\" + Installer.InstallDirectory + "\\" + Runtime.PythonDLL;
|
||||||
|
|
||||||
Runtime.PythonDLL = dllpath;
|
Runtime.PythonDLL = dllpath;
|
||||||
PythonEngine.Initialize();
|
//Runtime.PythonDLL = "python.dll";
|
||||||
|
|
||||||
|
PythonEngine.Initialize();
|
||||||
|
|
||||||
np = Py.Import(name: "numpy");
|
np = Py.Import(name: "numpy");
|
||||||
pd = Py.Import(name: "pandas");
|
pd = Py.Import(name: "pandas");
|
||||||
@@ -65,7 +68,7 @@ public class PandasTA : IDisposable
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
[Fact] void ADOSC() {
|
[Fact] void ADOSC() {
|
||||||
ADOSC_Series QL = new(bars);
|
ADOSC_Series QL = new(bars);
|
||||||
var pta = df.ta.adosc(high: df.high, low: df.low, close: df.close, volume: df.volume);
|
var pta = df.ta.adosc(high: df.high, low: df.low, close: df.close, volume: df.volume);
|
||||||
@@ -122,7 +125,7 @@ public class PandasTA : IDisposable
|
|||||||
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
|
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
[Fact]
|
[Fact]
|
||||||
void CMO() {
|
void CMO() {
|
||||||
CMO_Series QL = new(bars.Close, period, false);
|
CMO_Series QL = new(bars.Close, period, false);
|
||||||
@@ -133,7 +136,7 @@ public class PandasTA : IDisposable
|
|||||||
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
|
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
[Fact] void DEMA() {
|
[Fact] void DEMA() {
|
||||||
DEMA_Series QL = new(bars.Close, period, false);
|
DEMA_Series QL = new(bars.Close, period, false);
|
||||||
var pta = df.ta.dema(close: df.close, length: period);
|
var pta = df.ta.dema(close: df.close, length: period);
|
||||||
@@ -428,5 +431,5 @@ public class PandasTA : IDisposable
|
|||||||
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
|
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
@@ -470,6 +470,7 @@ public class Tulip_Test
|
|||||||
Assert.InRange(TU_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
|
Assert.InRange(TU_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
[Fact]
|
[Fact]
|
||||||
public void TRIX() {
|
public void TRIX() {
|
||||||
double[][] arrin = { inclose };
|
double[][] arrin = { inclose };
|
||||||
@@ -482,6 +483,7 @@ public class Tulip_Test
|
|||||||
Assert.InRange(TU_item! - QL_item, -Math.Exp(-digits+2), Math.Exp(-digits+2));
|
Assert.InRange(TU_item! - QL_item, -Math.Exp(-digits+2), Math.Exp(-digits+2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
[Fact]
|
[Fact]
|
||||||
public void VAR() {
|
public void VAR() {
|
||||||
double[][] arrin = { inclose };
|
double[][] arrin = { inclose };
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
pytz
|
||||||
|
six
|
||||||
|
python-dateutil
|
||||||
|
numpy
|
||||||
|
pandas
|
||||||
|
pandas-ta
|
||||||
Reference in New Issue
Block a user