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

condense read_<method>(fua) down to read_results(fua, method) #214

Closed
1 of 2 tasks
jGaboardi opened this issue Dec 7, 2024 · 4 comments · Fixed by #218
Closed
1 of 2 tasks

condense read_<method>(fua) down to read_results(fua, method) #214

jGaboardi opened this issue Dec 7, 2024 · 4 comments · Fixed by #218
Assignees
Labels

Comments

@jGaboardi
Copy link
Collaborator

jGaboardi commented Dec 7, 2024

As per @anastassiavybornova 's suggestion, we might want to condense the following down to something like read_results():

Something like:

def read_results(
    fua: int | str, method: str, proj_crs: str | int | pyproj.CRS
) -> geopandas.GeoDataFrame:
    """Read results parquet format.

    Parameters
    -----------
    fua : int | str
        Code or name of FUA.
    method : str
        Simplification method used.
    proj_crs : str | int | pyproj.CRS
        Projected CRS information.

    Returns
    --------
    geopandas.GeoDataFrame
        Simplified results from ``fua`` by ``method``.
    """

    return (
        geopandas.read_parquet(_fua_path(fua, method))
        .explode(ingore_index=True, index_parts=False)
        .to_crs(proj_crs)
    )

read_results('Aleppo', 'manual')
read_results('Aleppo', 'cityseer')
read_results('Aleppo', 'osmnx')
read_results('Aleppo', 'parent-skeleton')
read_results('Aleppo', 'parent-voronoi')
read_results('Aleppo', 'neatnet')

What do yall think?

  • yes
  • no

cc @martinfleis

@jGaboardi jGaboardi added the DRY label Dec 7, 2024
@jGaboardi jGaboardi self-assigned this Dec 7, 2024
@martinfleis
Copy link
Contributor

I don't think it matters. Do whatever you like :)

@jGaboardi
Copy link
Collaborator Author

I don't think it matters. Do whatever you like

You sound like a parent at wit's end. LOL

@anastassiavybornova
Copy link
Collaborator

@jGaboardi I think it's a great idea and encourage you to go ahead!

Trying to sound like the other parent but I also really mean it

@martinfleis
Copy link
Contributor

@jGaboardi go ask mom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants