Skip to content

Use dataframe #16

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Use dataframe #16

wants to merge 5 commits into from

Conversation

revesansparole
Copy link

pandas was already a dependency :)

@revesansparole revesansparole requested review from pradal and christian34 and removed request for pradal and christian34 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

@staticmethod
def DoAll(*args):
ratp = pyratp.ratp
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.


@staticmethod
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.

3 participants