test_python

This commit is contained in:
Miha Kralj
2023-01-06 14:05:41 -08:00
parent 661366940a
commit 3c9bfb265d
7 changed files with 38 additions and 37 deletions
+6
View File
@@ -1,6 +1,12 @@
name: Stage/build/test/release/publish
on:
workflow_dispatch:
push:
branches:
- '*'
pull_request:
branches:
- '*'
jobs:
build_test:
-6
View File
@@ -1,6 +0,0 @@
pytz>=2022
six>=1
python-dateutil>=2
numpy>=1.24
pandas>=1.5
pandas-ta>=0.3
+10 -20
View File
@@ -22,31 +22,21 @@ jobs:
with:
dotnet-version: |
7.0.x
5.0.x
include-prerelease: true
- name: Install Python
- uses: actions/setup-python@v4
uses: actions/setup-python@v4
with:
python-version: '3.11'
check-latest: true
python-version: '3.10'
check-latest: false
cache: 'pip'
cache-dependency-path: '**/requirements.txt'
- run: pip install -r worklflows/requirements.txt
cache-dependency-path: '\a\QuanTAlib\QuanTAlib\Tests\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
View File
@@ -9,7 +9,7 @@
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>
<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="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
+13 -10
View File
@@ -25,13 +25,16 @@ public class PandasTA : IDisposable
Installer.InstallPath = Path.GetFullPath(path: ".");
Installer.SetupPython().Wait();
Installer.TryInstallPip().Wait();
Installer.PipInstallModule(module_name: "numpy").Wait();
Installer.PipInstallModule(module_name: "pandas").Wait();
Installer.PipInstallModule(module_name: "pandas-ta").Wait();
dllpath = Installer.InstallPath + "\\" + Installer.InstallDirectory + "\\" + Runtime.PythonDLL;
Installer.TryInstallPip();
Installer.PipInstallModule(module_name: "numpy");
Installer.PipInstallModule(module_name: "pandas");
Installer.PipInstallModule(module_name: "pandas-ta");
dllpath = Installer.InstallPath + "\\" + Installer.InstallDirectory + "\\" + Runtime.PythonDLL;
Runtime.PythonDLL = dllpath;
PythonEngine.Initialize();
//Runtime.PythonDLL = "python.dll";
PythonEngine.Initialize();
np = Py.Import(name: "numpy");
pd = Py.Import(name: "pandas");
@@ -65,7 +68,7 @@ public class PandasTA : IDisposable
}
}
/*
[Fact] void ADOSC() {
ADOSC_Series QL = new(bars);
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));
}
}
/*
[Fact]
void CMO() {
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));
}
}
*/
[Fact] void DEMA() {
DEMA_Series QL = new(bars.Close, period, false);
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));
}
}
*/
}
+2
View File
@@ -470,6 +470,7 @@ public class Tulip_Test
Assert.InRange(TU_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
}
}
/*
[Fact]
public void TRIX() {
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));
}
}
*/
[Fact]
public void VAR() {
double[][] arrin = { inclose };
+6
View File
@@ -0,0 +1,6 @@
pytz
six
python-dateutil
numpy
pandas
pandas-ta