Skip to content

Commit 765abc8

Browse files
committed
Update README noting that the auto-generated stage factories include the available options in their docstring
1 parent 404821f commit 765abc8

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

README.rst

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,33 @@ Stage Objects
8080
- A stage can be instantiated by passing as keyword arguments the options
8181
applicable to the respective PDAL stage. For more on PDAL stages and their
8282
options, check the PDAL documentation on `Stage Objects <https://pdal.io/pipeline.html#stage-objects>`__.
83-
- The ``filename`` option of ``Readers`` and ``Writers`` as well as the ``type``
84-
option of ``Filters`` can be passed positionally as the first argument.
85-
- The ``inputs`` option specifies a sequence of stages to be set as input to the
86-
current stage. Each input can be either the string tag of another stage, or
87-
the ``Stage`` instance itself.
88-
- The ``Reader``, ``Filter`` and ``Writer`` classes come with classmethods for
83+
84+
- The ``filename`` option of ``Readers`` and ``Writers`` as well as the ``type``
85+
option of ``Filters`` can be passed positionally as the first argument.
86+
- The ``inputs`` option specifies a sequence of stages to be set as input to the
87+
current stage. Each input can be either the string tag of another stage, or
88+
the ``Stage`` instance itself.
89+
- The ``Reader``, ``Filter`` and ``Writer`` classes come with static methods for
8990
all the respective PDAL drivers. For example, ``pdal.Filter.head()`` is a
90-
shortcut for ``pdal.Filter(type="filters.head")``.
91+
shortcut for ``pdal.Filter(type="filters.head")``. These methods are
92+
auto-generated by introspecting ``pdal`` and the available options are
93+
included in each method's docstring:
94+
95+
.. code-block::
96+
97+
>>> help(pdal.Filter.head)
98+
Help on function head in module pdal.pipeline:
99+
100+
head(**kwargs)
101+
Return N points from beginning of the point cloud.
102+
103+
user_data: User JSON
104+
log: Debug output filename
105+
option_file: File from which to read additional options
106+
where: Expression describing points to be passed to this filter
107+
where_merge='auto': If 'where' option is set, describes how skipped points should be merged with kept points in standard mode.
108+
count='10': Number of points to return from beginning. If 'invert' is true, number of points to drop from the beginning.
109+
invert='false': If true, 'count' specifies the number of points to skip from the beginning.
91110
92111
Pipeline Objects
93112
================

pdal/drivers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def factory(self) -> Callable[..., Stage]:
4242
factory = lambda **kwargs: self.type(type=self.name, **kwargs)
4343
factory.__name__ = self.short_name
4444
factory.__qualname__ = f"{self.type.__name__}.{self.short_name}"
45+
factory.__module__ = self.type.__module__
4546
factory.__doc__ = self.description
4647
if self.options:
4748
factory.__doc__ += "\n\n"

0 commit comments

Comments
 (0)