Changeset 234c532 in sasmodels
- Timestamp:
- Oct 10, 2016 2:56:16 PM (8 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- e4bf271
- Parents:
- 689b7c4
- Location:
- sasmodels
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/compare.py
rbb2d187 r234c532 80 80 -edit starts the parameter explorer 81 81 -default/-demo* use demo vs default parameters 82 -html shows the model docs instead of running the model 82 83 83 84 Any two calculation engines can be selected for comparison: … … 736 737 'linear', 'log', 'q4', 737 738 'hist', 'nohist', 738 'edit', 739 'edit', 'html', 739 740 'demo', 'default', 740 741 ]) … … 845 846 'use_demo' : True, 846 847 'zero' : False, 848 'html' : False, 847 849 } 848 850 engines = [] … … 886 888 elif arg == '-demo': opts['use_demo'] = True 887 889 elif arg == '-default': opts['use_demo'] = False 890 elif arg == '-html': opts['html'] = True 888 891 # pylint: enable=bad-whitespace 889 892 … … 961 964 return opts 962 965 966 def show_docs(opts): 967 # type: (Dict[str, Any]) -> None 968 """ 969 show html docs for the model 970 """ 971 import wx # type: ignore 972 from .generate import view_html_from_info 973 app = wx.App() if wx.GetApp() is None else None 974 view_html_from_info(opts['def']) 975 if app: app.MainLoop() 976 977 963 978 def explore(opts): 964 979 # type: (Dict[str, Any]) -> None 965 980 """ 966 Explore the model using the Bumps GUI.981 explore the model using the bumps gui. 967 982 """ 968 983 import wx # type: ignore … … 1057 1072 opts = parse_opts(argv) 1058 1073 if opts is not None: 1059 if opts['explore']: 1074 if opts['html']: 1075 show_docs(opts) 1076 elif opts['explore']: 1060 1077 explore(opts) 1061 1078 else: -
sasmodels/generate.py
r462a115 r234c532 912 912 913 913 def view_html(model_name): 914 from . import rst2html915 914 from . import modelinfo 916 915 kernel_module = load_kernel_module(model_name) 917 916 info = modelinfo.make_model_info(kernel_module) 917 view_html_from_info(info) 918 919 def view_html_from_info(info): 920 from . import rst2html 918 921 url = "file://"+dirname(info.filename)+"/" 919 922 rst2html.wxview(make_html(info), url=url)
Note: See TracChangeset
for help on using the changeset viewer.