mirror of
https://github.com/wassname/catalyst.git
synced 2026-08-15 12:15:22 +08:00
MAINT: Use explicit syntax for relative imports.
Python 3 requires using dot syntax for relative imports, otherwise the import is treated as an absolute import, i.e. an import of a module from outside of the project. By using dot syntax now, imports should be compatible with both Python 2.7 and Python 3.
This commit is contained in:
+4
-4
@@ -6,10 +6,10 @@ Zipline
|
||||
# it is a place to expose the public interfaces.
|
||||
|
||||
|
||||
import data
|
||||
import finance
|
||||
import gens
|
||||
import utils
|
||||
from . import data
|
||||
from . import finance
|
||||
from . import gens
|
||||
from . import utils
|
||||
|
||||
from algorithm import TradingAlgorithm
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
import loader
|
||||
from . import loader
|
||||
|
||||
__all__ = ['loader']
|
||||
|
||||
@@ -22,7 +22,7 @@ from functools import partial
|
||||
|
||||
import requests
|
||||
|
||||
from loader_utils import (
|
||||
from . loader_utils import (
|
||||
date_conversion,
|
||||
source_to_records,
|
||||
Mapping
|
||||
|
||||
@@ -22,7 +22,7 @@ from datetime import timedelta
|
||||
|
||||
import logbook
|
||||
|
||||
from treasuries import get_treasury_data
|
||||
from . treasuries import get_treasury_data
|
||||
import benchmarks
|
||||
from benchmarks import get_benchmark_returns
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import requests
|
||||
from collections import OrderedDict
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
from loader_utils import (
|
||||
from . loader_utils import (
|
||||
guarded_conversion,
|
||||
safe_int,
|
||||
Mapping,
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
from collections import defaultdict
|
||||
import datetime
|
||||
|
||||
from utils.protocol_utils import Enum
|
||||
from . utils.protocol_utils import Enum
|
||||
|
||||
# Datasource type should completely determine the other fields of a
|
||||
# message with its type.
|
||||
|
||||
@@ -13,11 +13,11 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from mavg import MovingAverage
|
||||
from stddev import MovingStandardDev
|
||||
from vwap import MovingVWAP
|
||||
from returns import Returns
|
||||
from utils import BatchTransform, batch_transform
|
||||
from . mavg import MovingAverage
|
||||
from . stddev import MovingStandardDev
|
||||
from . vwap import MovingVWAP
|
||||
from . returns import Returns
|
||||
from . utils import BatchTransform, batch_transform
|
||||
|
||||
__all__ = [
|
||||
'MovingAverage',
|
||||
|
||||
Reference in New Issue
Block a user