Changeset 0d26e91 in sasmodels for sasmodels/resolution.py


Ignore:
Timestamp:
Mar 6, 2019 3:44:39 PM (5 years ago)
Author:
GitHub <noreply@…>
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
15f5138
Parents:
da3638f (diff), e589e9a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Paul Kienzle <pkienzle@…> (03/06/19 15:44:39)
git-committer:
GitHub <noreply@…> (03/06/19 15:44:39)
Message:

Merge branch 'beta_approx' into ticket-1015-gpu-mem-error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/resolution.py

    rda3638f r0d26e91  
    445445    q = np.sort(q) 
    446446    if q_min + 2*MINIMUM_RESOLUTION < q[0]: 
    447         n_low = np.ceil((q[0]-q_min) / (q[1]-q[0])) if q[1] > q[0] else 15 
    448         q_low = np.linspace(q_min, q[0], int(n_low)+1)[:-1] 
     447        n_low = int(np.ceil((q[0]-q_min) / (q[1]-q[0]))) if q[1] > q[0] else 15 
     448        q_low = np.linspace(q_min, q[0], n_low+1)[:-1] 
    449449    else: 
    450450        q_low = [] 
    451451    if q_max - 2*MINIMUM_RESOLUTION > q[-1]: 
    452         n_high = np.ceil((q_max-q[-1]) / (q[-1]-q[-2])) if q[-1] > q[-2] else 15 
    453         q_high = np.linspace(q[-1], q_max, int(n_high)+1)[1:] 
     452        n_high = int(np.ceil((q_max-q[-1]) / (q[-1]-q[-2]))) if q[-1] > q[-2] else 15 
     453        q_high = np.linspace(q[-1], q_max, n_high+1)[1:] 
    454454    else: 
    455455        q_high = [] 
     
    498498        if q_min < 0: 
    499499            q_min = q[0]*MINIMUM_ABSOLUTE_Q 
    500         n_low = np.ceil(log_delta_q * (log(q[0])-log(q_min))) 
    501         q_low = np.logspace(log10(q_min), log10(q[0]), int(n_low)+1)[:-1] 
     500        n_low = int(np.ceil(log_delta_q * (log(q[0])-log(q_min)))) 
     501        q_low = np.logspace(log10(q_min), log10(q[0]), n_low+1)[:-1] 
    502502    else: 
    503503        q_low = [] 
    504504    if q_max > q[-1]: 
    505         n_high = np.ceil(log_delta_q * (log(q_max)-log(q[-1]))) 
    506         q_high = np.logspace(log10(q[-1]), log10(q_max), int(n_high)+1)[1:] 
     505        n_high = int(np.ceil(log_delta_q * (log(q_max)-log(q[-1])))) 
     506        q_high = np.logspace(log10(q[-1]), log10(q_max), n_high+1)[1:] 
    507507    else: 
    508508        q_high = [] 
Note: See TracChangeset for help on using the changeset viewer.