Skip to content

Commit

Permalink
updating for refactoring of wc_lang.io
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrkarr committed Jan 7, 2019
1 parent a27bea9 commit ca93376
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
17 changes: 9 additions & 8 deletions rand_wc_model_gen/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
import rand_wc_model_gen
import rand_wc_model_gen.analysis
import rand_wc_model_gen.config
import wc_kb_gen.random
import wc_kb
import wc_kb.io
import wc_kb_gen.random
import wc_lang
import wc_lang.io
import wc_model_gen.prokaryote
import wc_sim.multialgorithm.run_results
Expand Down Expand Up @@ -60,14 +62,13 @@ def _default(self):
os.makedirs(os.path.dirname(config['kb']['path']['core']))
if not os.path.isdir(os.path.dirname(config['kb']['path']['seq'])):
os.makedirs(os.path.dirname(config['kb']['path']['seq']))
wc_kb.io.Writer().run(kb,
config['kb']['path']['core'], config['kb']['path']['seq'],
wc_kb.io.Writer().run(config['kb']['path']['core'], kb,
seq_path=config['kb']['path']['seq'],
set_repo_metadata_from_path=config['kb_gen']['set_repo_metadata_from_path'])

if not os.path.isdir(os.path.dirname(config['model']['path'])):
os.makedirs(os.path.dirname(config['model']['path']))
wc_lang.io.Writer().run(model,
config['model']['path'],
wc_lang.io.Writer().run(config['model']['path'], model,
set_repo_metadata_from_path=config['model_gen']['set_repo_metadata_from_path'])


Expand All @@ -89,7 +90,7 @@ def _default(self):
args = self.app.pargs
config = rand_wc_model_gen.config.get_config(extra_path=args.config_path)['rand_wc_model_gen']

model = wc_lang.io.Reader().run(config['model']['path'])
model = wc_lang.io.Reader().run(config['model']['path'])[wc_lang.Model][0]

seed = args.seed
if seed is None:
Expand Down Expand Up @@ -122,8 +123,8 @@ class Meta:
def _default(self):
args = self.app.pargs
config = rand_wc_model_gen.config.get_config(extra_path=args.config_path)['rand_wc_model_gen']
kb = wc_kb.io.Reader().run(config['kb']['path']['core'], config['kb']['path']['seq'])
model = wc_lang.io.Reader().run(config['model']['path'])
kb = wc_kb.io.Reader().run(config['kb']['path']['core'], config['kb']['path']['seq'])[wc_kb.KnowledgeBase][0]
model = wc_lang.io.Reader().run(config['model']['path'])[wc_lang.Model][0]
runner = rand_wc_model_gen.analysis.AnalysisRunner(kb, model, config['sim_results']['path'],
out_path=config['analysis']['path'],
options=config['analysis'])
Expand Down
4 changes: 2 additions & 2 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ def test_generate(self):
self.assertTrue(os.path.isfile(self.kb_core_path))
self.assertTrue(os.path.isfile(self.kb_seq_path))
self.assertTrue(os.path.isfile(self.model_path))
kb = wc_kb.io.Reader().run(self.kb_core_path, self.kb_seq_path)
model = wc_lang.io.Reader().run(self.model_path)
kb = wc_kb.io.Reader().run(self.kb_core_path, self.kb_seq_path)[wc_kb.KnowledgeBase][0]
model = wc_lang.io.Reader().run(self.model_path)[wc_lang.Model][0]

@unittest.skipIf(os.getenv('CIRCLECI', '0') in ['1', 'true'], 'Too long for CircleCI')
def test_simulate(self):
Expand Down

0 comments on commit ca93376

Please sign in to comment.