materialsproject / api

New API client for the Materials Project
https://materialsproject.github.io/api/
Other
105 stars 33 forks source link

[Feature Request]: Documentation update #878

Closed minhsueh closed 4 months ago

minhsueh commented 6 months ago

Suggestion

This is a fantastic project; I appreciate that it is open-source.

I suggest modifying the documentation at https://docs.materialsproject.org/downloading-data/using-the-api/examples#calculation-task-ids-and-types-for-silicon-mp-149 and https://docs.materialsproject.org/downloading-data/using-the-api/advanced-usage.

As the warning in MPRester states, mpr.summary should be modified to mpr.materials.summary

    def __getattr__(self, attr):
        if attr in self._deprecated_attributes:
            warnings.warn(
                f"Accessing {attr} data through MPRester.{attr} is deprecated. "
                f"Please use MPRester.materials.{attr} instead.",
                DeprecationWarning,
                stacklevel=2,
            )
            return getattr(super().__getattribute__("materials"), attr)
        else:
            raise AttributeError(
                f"{self.__class__.__name__!r} object has no attribute {attr!r}"
            )

Proposed Solution

Updating documentation helps a new user (like me) learn how to use API correctly.

Alternatives

No response

munrojm commented 6 months ago

Absolutely, thanks for the nudge.