Changeset ff58110 in sasmodels


Ignore:
Timestamp:
Feb 19, 2015 5:52:15 AM (10 years ago)
Author:
pkienzle
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
62b3cb2, 3a45c2c
Parents:
a006b63
Message:

allow source gen from command line

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/generate.py

    r3271e20 rff58110  
    757757    print "time:",toc() 
    758758 
    759 def demo(): 
    760     from .models import cylinder 
    761     source, info = make(cylinder) 
    762     #print doc(cylinder) 
    763     print source 
     759def main(): 
     760    if len(sys.argv) <= 1: 
     761        print "usage: python -m sasmodels.generate modelname" 
     762    else: 
     763        name = sys.argv[1] 
     764        import sasmodels.models 
     765        __import__('sasmodels.models.'+name) 
     766        model = getattr(sasmodels.models, name) 
     767        source, info = make(model); print source 
     768        #print doc(model) 
    764769 
    765770if __name__ == "__main__": 
    766     demo() 
     771    main() 
Note: See TracChangeset for help on using the changeset viewer.