Skip to content

Commit

Permalink
bug fix in Fityk::get_variable()
Browse files Browse the repository at this point in the history
  • Loading branch information
wojdyr committed Jan 7, 2016
1 parent 03ba7d4 commit 7d96856
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion fityk/fityk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ const Var* Fityk::get_variable(string const& name) throw(ExecuteError)
vname = string(name, 1);
else if (name[0] == '%' && name.find('.') < name.size() - 1) {
string::size_type pos = name.find('.');
Function const* f = priv_->mgr.find_function(string(1, pos-1));
Function const* f = priv_->mgr.find_function(name.substr(1, pos-1));
string pname = name.substr(pos+1);
vname = f->used_vars().get_name(f->get_param_nr(pname));
} else
Expand Down
1 change: 1 addition & 0 deletions tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def test_pseudovoigt_shape_domain(self):
def test_defval_bounds(self):
self.ftk.execute("define My(a=3, b=0.1[-1:1]) = a*exp(b*x)")
self.ftk.execute("%f=My(a=3)")
self.assertEqual(self.ftk.get_variable("%f.b").name, "_2")
a = self.ftk.get_variable("_2")
self.assertEqual(a.value(), 0.1)
self.assertEqual(a.domain.lo, -1)
Expand Down

0 comments on commit 7d96856

Please sign in to comment.