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

Is region_id required to be an integer? #211

Open
leewujung opened this issue Aug 10, 2024 · 0 comments
Open

Is region_id required to be an integer? #211

leewujung opened this issue Aug 10, 2024 · 0 comments

Comments

@leewujung
Copy link
Member

So I have run into this situation where I have the region_id from multiple EVR files, and I merged the Regions2D.data dataframe and then saved the rows I want into a csv file. Then I used read_region_csv to read the csv back as a Regions2D object. However, during the merging of multiple r2d.data dataframes, I had to alter the values of region_id so that the ids are unique, otherwise read_region_csv will throw error. The change I made was something like 0707_17, for a region from July 7, region_id=7, just so that the region_id would not be identical with region_id from other EVRs, like below:
Screenshot 2024-08-09 at 6 30 53 PM

But when the csv was read back into a Regions2D using read_region_csv, the region_id column was read as int64:
Screenshot 2024-08-09 at 6 31 13 PM

From the code it seems that the only place we require region_id to be an int is when creating it from the EVR file since it was from text. I wonder why this happens, and also wondering if region_id should always be an integer, or that we allow it to be other type too? In that case I guess I can explicitly cast it before saving?

@ctuguinay have you run into something like this before?

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

No branches or pull requests

1 participant