Skip to content

Conversation

@revesansparole
Copy link

pandas was already a dependency :)

@revesansparole revesansparole requested review from christian34 and pradal and removed request for christian34 and pradal July 25, 2018 14:35
Copy link
Contributor

@pradal pradal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just two remarks. Very good idea to move from numpy array to pandas dataframe.
When we first write this code, pandas did not exist

pyratp.dir_interception.scattering = False
ratp.out_time_spatial = np.zeros(pyratp.micrometeo.nbli*pyratp.grid3d.nveg*22*pyratp.grid3d.nent).reshape(pyratp.micrometeo.nbli*pyratp.grid3d.nveg*pyratp.grid3d.nent,22)
ratp.out_time_tree = np.zeros(pyratp.micrometeo.nbli*8*pyratp.grid3d.nent).reshape(pyratp.micrometeo.nbli*pyratp.grid3d.nent ,8)
ratp.out_time_spatial = np.zeros((pyratp.micrometeo.nbli * pyratp.grid3d.nveg * pyratp.grid3d.nent, 22))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace 22 by len(columns).
And 8 by len(columns_tree).
Otherelse it is cryptic: Is 8 refers to 8 bytes... it takes me some seconds to figure out what 22 and 8 means.

def DoIrradiation(*args):
ratp = pyratp.ratp
ratp.out_rayt = np.zeros(pyratp.micrometeo.nbli*pyratp.grid3d.nveg*9*pyratp.grid3d.nent).reshape(pyratp.micrometeo.nbli*pyratp.grid3d.nveg*pyratp.grid3d.nent ,9)
ratp.out_rayt = np.zeros((pyratp.micrometeo.nbli * pyratp.grid3d.nveg * pyratp.grid3d.nent, 9))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, what 9 means?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no idea, I just took the opportunity of this branch to change a reshape by directly passing the shape to np.zeros :)
But I'll investigate

@revesansparole
Copy link
Author

I also left the code that write an output file in a temporary directory. The same code has been commented in in DoIrradiance. Shall we comment it too?

@revesansparole
Copy link
Author

Used a DEBUG constant and moved the code in a separate function as a pis-aller

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants