Skip to content

Commit

Permalink
Fix reporting of NNNL in xhtml
Browse files Browse the repository at this point in the history
  • Loading branch information
jpn-- committed Jan 20, 2017
1 parent 5c5e53a commit f53d69c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
15 changes: 12 additions & 3 deletions py/nnnl.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,12 +417,13 @@ def maximize_loglike(self, *args, **kwargs):
self.probability_roll_up()
return result

def xhtml_utilityspec(self, *arg, **kwarg):
return self.base_model.xhtml_utilityspec(*arg, **kwarg)


# Utility Specification Summary
def xhtml_utilityspec(self,**format):

from .util.xhtml import XML_Builder
NonBreakSpace = " "

if len(self.base_model.utility.co)==0: return self.base_model.xhtml_utilityspec_ca_only(**format)
existing_format_keys = list(format.keys())
for key in existing_format_keys:
Expand Down Expand Up @@ -555,6 +556,9 @@ def add_util_component(beta, resolved, x, first_thing):

# Probability Specification Summary
def xhtml_probabilityspec(self,**format):

from .util.xhtml import XML_Builder

existing_format_keys = list(format.keys())
for key in existing_format_keys:
if key.upper()!=key: format[key.upper()] = format[key]
Expand Down Expand Up @@ -639,4 +643,9 @@ def add_part():
return x.close()


def xhtml_nesting_tree(self,*arg,**kwarg):
return self.base_model.xhtml_nesting_tree(*arg,**kwarg)

def xhtml_nesting_tree_textonly(self,*arg,**kwarg):
return self.base_model.xhtml_nesting_tree_textonly(*arg,**kwarg)

14 changes: 14 additions & 0 deletions py/test/test_nl.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,20 @@ def test_nnnl(self):
self.assertNearlyEqual(-676045.5230709405, mx.loglike())
jj=m.gradient_check()
self.assertTrue(jj[0]<-6)
cats = [ '!',
'sessionlog',
'utilityspec',
'probabilityspec',
'DATA',
'excludedcases',
'NOTES',
'options',
'possible_overspecification',
'nesting_tree',
'&', ]
# make sure no errors are raised in reporting
m.xhtml(*cats)
m.xhtml('*')


def test_nnnl_quant(self):
Expand Down

0 comments on commit f53d69c

Please sign in to comment.