Changeset da3638f in sasmodels


Ignore:
Timestamp:
Mar 6, 2019 1:39:41 PM (5 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
0d26e91
Parents:
36a2418
Message:

fix numpy deprecation warnings from automatic float to integer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/resolution.py

    r9e7837a rda3638f  
    446446    if q_min + 2*MINIMUM_RESOLUTION < q[0]: 
    447447        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], n_low+1)[:-1] 
     448        q_low = np.linspace(q_min, q[0], int(n_low)+1)[:-1] 
    449449    else: 
    450450        q_low = [] 
    451451    if q_max - 2*MINIMUM_RESOLUTION > q[-1]: 
    452452        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, n_high+1)[1:] 
     453        q_high = np.linspace(q[-1], q_max, int(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 = log_delta_q * (log(q[0])-log(q_min)) 
    501         q_low = np.logspace(log10(q_min), log10(q[0]), np.ceil(n_low)+1)[:-1] 
     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] 
    502502    else: 
    503503        q_low = [] 
    504504    if q_max > q[-1]: 
    505         n_high = log_delta_q * (log(q_max)-log(q[-1])) 
    506         q_high = np.logspace(log10(q[-1]), log10(q_max), np.ceil(n_high)+1)[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:] 
    507507    else: 
    508508        q_high = [] 
Note: See TracChangeset for help on using the changeset viewer.