Skip to content

Commit

Permalink
fixed circular import bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kervias committed Jul 4, 2023
1 parent 35c854e commit e471ebd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
7 changes: 4 additions & 3 deletions edustudio/datatpl/common/general_datatpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import json
from deepdiff import DeepDiff
import importlib
from edustudio.atom_op.mid2cache import BaseMid2Cache
from edustudio.atom_op.raw2mid import BaseRaw2Mid
import torch


Expand Down Expand Up @@ -365,7 +363,8 @@ def get_default_cfg(cls, mid2cache_op_seq, **kwargs):
assert mid2cache_op_seq is not None

# cfg.mid2cache_op_seq = mid2cache_op_seq

from edustudio.atom_op.mid2cache import BaseMid2Cache
from edustudio.atom_op.raw2mid import BaseRaw2Mid
for op in mid2cache_op_seq:
if isinstance(op, str):
op = importlib.import_module('edustudio.atom_op.mid2cache').__getattribute__(op)
Expand All @@ -379,6 +378,7 @@ def get_default_cfg(cls, mid2cache_op_seq, **kwargs):

@classmethod
def _get_r2m_op(cls, cfg):
from edustudio.atom_op.raw2mid import BaseRaw2Mid
r2m_op = cfg.datatpl_cfg['raw2mid_op']
assert r2m_op is not None
if isinstance(r2m_op, str):
Expand All @@ -390,6 +390,7 @@ def _get_r2m_op(cls, cfg):
return r2m_op.from_cfg(cfg)

def _get_m2c_op_list(self):
from edustudio.atom_op.mid2cache import BaseMid2Cache
m2c_op_list = self.datatpl_cfg['mid2cache_op_seq']
op_list = []
for op in m2c_op_list:
Expand Down
12 changes: 6 additions & 6 deletions examples/single_model/run_dkt_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
run_edustudio(
dataset='ASSIST_0910',
cfg_file_name=None,
datafmt_cfg_dict={
datatpl_cfg_dict={
'cls': 'KTInterCptAsExerDataTPL',
},
trainfmt_cfg_dict={
'cls': 'KTInterTrainFmt',
traintpl_cfg_dict={
'cls': 'KTInterTrainTPL',
},
model_cfg_dict={
modeltpl_cfg_dict={
'cls': 'DKT',
},
evalfmt_cfg_dict={
'clses': ['BinaryClassificationEvalFmt'],
evaltpl_cfg_dict={
'clses': ['BinaryClassificationEvalTPL'],
}
)
1 change: 0 additions & 1 deletion examples/single_model/run_hiercdf_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../../")
os.chdir(os.path.dirname(os.path.abspath(__file__)))

from edustudio.model.CD import HierCDF
from edustudio.quickstart import run_edustudio
from edustudio.atom_op.mid2cache.CD import M2C_FilterRecords4CD

Expand Down

0 comments on commit e471ebd

Please sign in to comment.