Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metrics filtering #24

Closed
opotowsky opened this issue Jan 30, 2015 · 9 comments
Closed

metrics filtering #24

opotowsky opened this issue Jan 30, 2015 · 9 comments
Assignees
Labels
Defect A bug in an existing feature that should work

Comments

@opotowsky
Copy link
Member

It seems I can filter on a root table just fine, but when I want to filter a metric, I get this type of error when trying to filter by any column other than QualId (pretty sure I tried all of the columns for the Materials metric):

$ cymetric lwr.sqlite -e "print(Materials[NucId != 922380000])"
/home/opotowsky/.local/lib/python2.7/site-packages/cymetric/metrics.py:12: QAWarning: pyne.data is not yet QA compliant.
  from pyne import data
Traceback (most recent call last):
  File "/home/opotowsky/.local/bin/cymetric", line 4, in <module>
    main()
  File "/home/opotowsky/.local/lib/python2.7/site-packages/cymetric/main.py", line 31, in main
    exec_code(ns.exec_code, db)
  File "/home/opotowsky/.local/lib/python2.7/site-packages/cymetric/execution.py", line 197, in exec_code
    exec(code, glb, loc)
  File "<string>", line 1, in <module>
  File "/home/opotowsky/.local/lib/python2.7/site-packages/cymetric/execution.py", line 123, in __getitem__
    return self.evaler.eval(self.name, conds=conds)
  File "/home/opotowsky/.local/lib/python2.7/site-packages/cymetric/evaluator.py", line 59, in eval
    d = self.eval(dep[0], conds=conds)
  File "/home/opotowsky/.local/lib/python2.7/site-packages/cymetric/evaluator.py", line 62, in eval
    raw = m(series=series, conds=conds, known_tables=self.known_tables)
  File "/home/opotowsky/.local/lib/python2.7/site-packages/cymetric/root_metrics.py", line 27, in __call__
    return self.db.query(self.name, conds=conds)
  File "cyclus.pyx", line 123, in cymetric.cyclus._FullBackend.query (/home/opotowsky/cyclus/cymetric/build/cymetric/cyclus.cxx:2586)
RuntimeError: SQL error [SELECT * FROM Resources WHERE NucId != ?;]: no such column: NucId
@opotowsky opotowsky added the Defect A bug in an existing feature that should work label Jan 30, 2015
@scopatz
Copy link
Member

scopatz commented Jan 31, 2015

Just to double check. Materials did not exist before, right? I think I know how to fix this.

@opotowsky
Copy link
Member Author

Are you asking if Materials was in the db before I tried to filter it? I don't remember, trying again now

@scopatz
Copy link
Member

scopatz commented Jan 31, 2015

Yeah, that is what I was asking. Sorry if that wasn't clear.

@opotowsky
Copy link
Member Author

Confirmed: it does not work before or after Materials exists!

@scopatz
Copy link
Member

scopatz commented Feb 11, 2015

Weird, this seems to be a SQL only issue.

@opotowsky
Copy link
Member Author

I hate that you have more ammo in you anti-SQL war. I can't do HDF5 at home so I generally don't do it at all, otherwise I may have figured that out already!

@scopatz
Copy link
Member

scopatz commented Feb 11, 2015

I am not on fighting SQL as a solution, just as the only solution -- which is easy because I am right :)

More seriously, I have figured out what the issue is.

@opotowsky
Copy link
Member Author

AWESOME*

*as long as the issue isn't too hairy

@opotowsky
Copy link
Member Author

closed via #28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Defect A bug in an existing feature that should work
Projects
None yet
Development

No branches or pull requests

2 participants