Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi-input modules can't mix steps and sources #22

Open
ircwaves opened this issue Apr 24, 2018 · 0 comments
Open

multi-input modules can't mix steps and sources #22

ircwaves opened this issue Apr 24, 2018 · 0 comments

Comments

@ircwaves
Copy link
Contributor

Created by: rbraswell

Inputs to modules that use more than one input must either all be sources, or all be steps.

Steps must be either "initial" or not initial. Suggest adding a step type called mixed, and coding around that.

    for step in steps:                                                                                                                                                               
                                                                                                                                                                                     
        if step['initial'] == True:                                                                                                                                                  
            bix = [sourcenames.index(si) for si in step['inputs']]                                                                                                                   
            d = data[bix,:,:,:]                                                                                                                                                      
        else:                                                                                                                                                                        
            d = np.array([results[si] for si in step['inputs']])                                                                                                                     
                                                                                                                                                                                     
        if d.shape[0] == 1:                                                                                                                                                          
            d = d.reshape(d.shape[1], nyr, npx)                                                                                                                                      
                                                                                                                                                                                     
        print step['name'], d.shape,                                                                                                                                                 
        results[step['name']] = step['function'](d, missing_out, step['params'])                                                                                                     
        if step.get('output', False):                                                                                                                                                
            OUTPUT[step['name']][:, :, istart:iend] = results[step['name']]                                                                                                          
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant