Include Usage Examples in Pip Package
Would it be possible to include the usage examples in the pip package? This seems to be a common practice in other packages, like xgboost_ray.
For example, I can run this code after installing xgboost_ray:
https://github.com/ray-project/xgboost_ray/tree/master/xgboost_ray/examples
from xgboost_ray.examples import simple
simple.main(1, 4)
~
2023-11-01 14:59:08,801 INFO worker.py:1616 -- Started a local Ray instance. View the dashboard at 127.0.0.1:8265
2023-11-01 14:59:10,655 INFO main.py:1140 -- [RayXGBoost] Created 4 new actors (4 total actors). Waiting until actors are ready for training.
2023-11-01 14:59:16,641 INFO main.py:1191 -- [RayXGBoost] Starting XGBoost training.
(_RemoteRayXGBoostActor pid=10499) [14:59:16] task [xgboost.ray]:134286839452944 got new rank 0
2023-11-01 14:59:20,728 INFO main.py:1708 -- [RayXGBoost] Finished XGBoost training on training data with total N=426 in 10.38 seconds (4.07 pure XGBoost training time).
Final validation error: 0.0280
I like the idea of having examples close to the library, but we have a mix of examples, some are easy to run while others are more complicated. For instance, the example might require downloading a dataset, passing in a command line argument, etc. If we split the examples into two places, it might cause extra confusion for users to find examples.
I was just suggesting that you include the examples in the pip package in their same format and structure. So they would continue to exist in the same place in github, but they would also get packaged into the pip package. At least the simple examples would be even easier to run.
We will continue to use the documentation side and sphinx gallery to share examples, but it's unlikely that we will make extra specializations in packaging in the near future.