mirror of
https://github.com/microsoft/qlib.git
synced 2026-06-06 05:51:17 +08:00
update python version (#1868)
* update python version * fix: Correct selector handling and add time filtering in storage.py * fix: convert index and columns to list in repr methods * feat: Add Makefile for managing project prerequisites * feat: Add Cython extensions for rolling and expanding operations * resolve install error * fix lint error * fix lint error * fix lint error * fix lint error * fix lint error * update build package * update makefile * update ci yaml * fix docs build error * fix ubuntu install error * fix docs build error * fix install error * fix install error * fix install error * fix install error * fix pylint error * fix pylint error * fix pylint error * fix pylint error * fix pylint error E1123 * fix pylint error R0917 * fix pytest error * fix pytest error * fix pytest error * update code * update code * fix ci error * fix pylint error * fix black error * fix pytest error * fix CI error * fix CI error * add python version to CI * add python version to CI * add python version to CI * fix pylint error * fix pytest general nn error * fix CI error * optimize code * add coments * Extended macos version * remove build package --------- Co-authored-by: Young <afe.young@gmail.com>
This commit is contained in:
@@ -16,7 +16,7 @@ from qlib.data import D
|
||||
class TestDataLoader(unittest.TestCase):
|
||||
|
||||
def test_nested_data_loader(self):
|
||||
qlib.init()
|
||||
qlib.init(kernels=1)
|
||||
nd = NestedDataLoader(
|
||||
dataloader_l=[
|
||||
{
|
||||
@@ -30,7 +30,7 @@ class TestDataLoader(unittest.TestCase):
|
||||
)
|
||||
# Of course you can use StaticDataLoader
|
||||
|
||||
dataset = nd.load()
|
||||
dataset = nd.load(start_time="2020-01-01", end_time="2020-01-31")
|
||||
|
||||
assert dataset is not None
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT License.
|
||||
import unittest
|
||||
import platform
|
||||
import mlflow
|
||||
import time
|
||||
from pathlib import Path
|
||||
@@ -26,7 +27,10 @@ class MLflowTest(unittest.TestCase):
|
||||
_ = mlflow.tracking.MlflowClient(tracking_uri=str(self.TMP_PATH))
|
||||
end = time.time()
|
||||
elapsed = end - start
|
||||
self.assertLess(elapsed, 1e-2) # it can be done in less than 10ms
|
||||
if platform.system() == "Linux":
|
||||
self.assertLess(elapsed, 1e-2) # it can be done in less than 10ms
|
||||
else:
|
||||
self.assertLess(elapsed, 2e-2)
|
||||
print(elapsed)
|
||||
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ class IndexDataTest(unittest.TestCase):
|
||||
print(sd.loc[:"c"])
|
||||
|
||||
def test_corner_cases(self):
|
||||
sd = idd.MultiData([[1, 2], [3, np.NaN]], index=["foo", "bar"], columns=["f", "g"])
|
||||
sd = idd.MultiData([[1, 2], [3, np.nan]], index=["foo", "bar"], columns=["f", "g"])
|
||||
print(sd)
|
||||
|
||||
self.assertTrue(np.isnan(sd.loc["bar", "g"]))
|
||||
|
||||
@@ -50,6 +50,8 @@ class TestNN(TestAutoData):
|
||||
model_l = [
|
||||
GeneralPTNN(
|
||||
n_epochs=2,
|
||||
batch_size=32,
|
||||
n_jobs=0,
|
||||
pt_model_uri="qlib.contrib.model.pytorch_gru_ts.GRUModel",
|
||||
pt_model_kwargs={
|
||||
"d_feat": 3,
|
||||
@@ -60,6 +62,8 @@ class TestNN(TestAutoData):
|
||||
),
|
||||
GeneralPTNN(
|
||||
n_epochs=2,
|
||||
batch_size=32,
|
||||
n_jobs=0,
|
||||
pt_model_uri="qlib.contrib.model.pytorch_nn.Net", # it is a MLP
|
||||
pt_model_kwargs={
|
||||
"input_dim": 3,
|
||||
|
||||
@@ -8,7 +8,6 @@ import shutil
|
||||
import unittest
|
||||
import pytest
|
||||
import pandas as pd
|
||||
import baostock as bs
|
||||
from pathlib import Path
|
||||
|
||||
from qlib.data import D
|
||||
|
||||
Reference in New Issue
Block a user