Skip to content

Add a new method to get related places.#113

Merged
Spaceenter merged 2 commits intodatacommonsorg:masterfrom
Spaceenter:rp
Jan 30, 2020
Merged

Add a new method to get related places.#113
Spaceenter merged 2 commits intodatacommonsorg:masterfrom
Spaceenter:rp

Conversation

@Spaceenter
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread datacommons/places.py Outdated
'geoId/06015',
'geoId/06023',
]
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Need to update example?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The examples just show the format -- the result would change as we change algorithms to compute relatedness.

Copy link
Copy Markdown
Contributor

@pradh pradh left a comment

Choose a reason for hiding this comment

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

Comment thread datacommons/places.py Outdated
""" Returns :obj:`Place`s related to :code:`dcids` for the given constraints.

Args:
dcids (:obj:`iterable` of :obj:`str`): Dcids to get contained in places.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

related

Comment thread datacommons/places.py Outdated


def get_related_places(dcids, population_type, constraining_properties={},
measured_prop='count',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

measured_property

Comment thread datacommons/places.py Outdated
:obj:`StatisticalPopulation` should be constrained by.
measured_property (:obj:`str`): The measured property.
stat_type (:obj:`str`): The statistical type for the observation.
within_place(:obj:`str`): Optional, the place that all the related places
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

place dcid?

Comment thread datacommons/places.py Outdated
`PerCapita` when compute the relatedness.
same_place_type(:obj:`bool`): Optional, whether to require all the
related places under the same ancestor place.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same place type?

Comment thread datacommons/places.py Outdated
Specifying the :code:`dcids` as a :obj:`list` result in the following.

>>> get_places_in(["geoId/06"], "Person", {
"age": "Years21To64",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

get_related_places

@Spaceenter Spaceenter merged commit 7b9ee2f into datacommonsorg:master Jan 30, 2020
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