Skip to content

Commit

Permalink
docs: give reference docs a more organized layout
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud authored and jcrist committed Sep 7, 2023
1 parent 6c70373 commit 583af94
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 29 deletions.
69 changes: 50 additions & 19 deletions docs/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,30 @@ website:
style: "docked"
collapse-level: 2
contents:
- auto: reference/*.qmd
- section: Expression API
contents:
- reference/top_level.qmd
- reference/expression-tables.qmd
- reference/expression-generic.qmd
- reference/expression-strings.qmd
- reference/expression-numeric.qmd
- reference/expression-temporal.qmd
- reference/expression-collections.qmd
- reference/expression-geospatial.qmd
- reference/selectors.qmd

- section: Type system
contents:
- reference/datatypes.qmd
- reference/schemas.qmd

- section: Configuration
contents:
- reference/ContextAdjustment.qmd
- reference/Interactive.qmd
- reference/Options.qmd
- reference/Repr.qmd
- reference/SQL.qmd

format:
html:
Expand All @@ -158,8 +181,8 @@ quartodoc:
member_options:
signature_name: short
sections:
- title: Expressions
desc: ""
- title: Expression API
desc: "APIs for manipulating table, column and scalar expressions"
package: ibis.expr.types
contents:
- kind: page
Expand Down Expand Up @@ -367,25 +390,33 @@ quartodoc:
- last
- all

- title: Type System
desc: "Data types and schemas"
package: ibis
contents:
- kind: page
path: datatypes-schemas
package: ibis.expr
path: datatypes
package: ibis.expr.datatypes
summary:
name: Data types and schemas
desc: Data types and schemas
name: Data types
desc: Data types
contents:
- name: Schema
package: ibis.expr.schema
- datatypes.core

- core
- kind: page
path: config
package: ibis.config
path: schemas
package: ibis.expr.schema
summary:
name: Config
desc: Ibis configuration
name: Schemas
desc: Schemas
contents:
- Options
- Repr
- SQL
- ContextAdjustment
- Schema

- title: Configuration
desc: "Ibis configuration"
package: ibis.config
contents:
- ContextAdjustment
- Interactive
- Options
- Repr
- SQL
2 changes: 0 additions & 2 deletions gen_redirects.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@
"/ibis-for-pandas-users/": "/tutorial/ibis-for-pandas-users/",
"/ibis-for-sql-programmers/": "/tutorial/ibis-for-sql-users/",
"/reference/backends/pandas/": "/backends/pandas/",
"/reference/datatypes/": "/reference/datatypes-schemas/",
"/reference/expressions/": "/reference/",
"/reference/expressions/collections/": "/reference/expression-collections",
"/reference/expressions/generic/": "/reference/expression-generic",
Expand All @@ -105,7 +104,6 @@
"/reference/expressions/tables/": "/reference/expressions-tables",
"/reference/expressions/timestamps/": "/reference/expression-temporal",
"/reference/expressions/top_level/": "/reference/top_level",
"/reference/schemas/": "/reference/datatypes-schemas",
"/tutorial/": "/tutorials/getting_started/",
"/tutorial/getting_started/": "/tutorials/getting_started",
"/tutorial/ibis-for-dplyr-users/": "/tutorials/ibis-for-dplyr-users/",
Expand Down
4 changes: 2 additions & 2 deletions ibis/expr/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def schema(
names: Iterable[str] | None = None,
types: Iterable[str | dt.DataType] | None = None,
) -> sch.Schema:
"""Validate and return a [`Schema`](./datatypes-schemas.qmd#ibis.expr.schema.Schema) object.
"""Validate and return a [`Schema`](./schemas.qmd#ibis.expr.schema.Schema) object.
Parameters
----------
Expand Down Expand Up @@ -344,7 +344,7 @@ def memtable(
columns
Optional [](`typing.Iterable`) of [](`str`) column names.
schema
Optional [`Schema`](./datatypes-schemas.qmd#ibis.expr.schema.Schema).
Optional [`Schema`](./schemas.qmd#ibis.expr.schema.Schema).
The functions use `data` to infer a schema if not passed.
name
Optional name of the table.
Expand Down
8 changes: 4 additions & 4 deletions ibis/expr/datatypes/value.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def infer(value: Any) -> dt.DataType:
# which should trigger infer_map instead
@infer.register(collections.OrderedDict)
def infer_struct(value: Mapping[str, Any]) -> dt.Struct:
"""Infer the [`Struct`](./datatypes-schemas.qmd#ibis.expr.datatypes.Struct) type of `value`."""
"""Infer the [`Struct`](./datatypes.qmd#ibis.expr.datatypes.Struct) type of `value`."""
if not value:
raise TypeError("Empty struct type not supported")
fields = {name: infer(val) for name, val in value.items()}
Expand All @@ -48,7 +48,7 @@ def infer_struct(value: Mapping[str, Any]) -> dt.Struct:

@infer.register(collections.abc.Mapping)
def infer_map(value: Mapping[Any, Any]) -> dt.Map:
"""Infer the [`Map`](./datatypes-schemas.qmd#ibis.expr.datatypes.Map) type of `value`."""
"""Infer the [`Map`](./datatypes.qmd#ibis.expr.datatypes.Map) type of `value`."""
if not value:
return dt.Map(dt.null, dt.null)
try:
Expand All @@ -62,7 +62,7 @@ def infer_map(value: Mapping[Any, Any]) -> dt.Map:

@infer.register((list, tuple, set, frozenset))
def infer_list(values: Sequence[Any]) -> dt.Array:
"""Infer the [`Array`](./datatypes-schemas.qmd#ibis.expr.datatypes.Array) type of `value`."""
"""Infer the [`Array`](./datatypes.qmd#ibis.expr.datatypes.Array) type of `value`."""
if not values:
return dt.Array(dt.null)
return dt.Array(highest_precedence(map(infer, values)))
Expand Down Expand Up @@ -140,7 +140,7 @@ def infer_enum(_: enum.Enum) -> dt.String:

@infer.register(decimal.Decimal)
def infer_decimal(value: decimal.Decimal) -> dt.Decimal:
"""Infer the [`Decimal`](./datatypes-schemas.qmd#ibis.expr.datatypes.Decimal) type of `value`."""
"""Infer the [`Decimal`](./datatypes.qmd#ibis.expr.datatypes.Decimal) type of `value`."""
return dt.decimal


Expand Down
2 changes: 1 addition & 1 deletion ibis/expr/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Schema(Concrete, Coercible, MapSet):

fields: FrozenDict[str, dt.DataType]
"""A mapping of [](`str`) to
[`DataType`](./datatypes-schemas.qmd#ibis.expr.datatypes.DataType)
[`DataType`](./datatypes.qmd#ibis.expr.datatypes.DataType)
objects representing the type of each column."""

def __repr__(self) -> str:
Expand Down
2 changes: 1 addition & 1 deletion ibis/expr/types/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1640,7 +1640,7 @@ def literal(value: Any, type: dt.DataType | str | None = None) -> Scalar:
value
A Python value
type
An instance of [`DataType`](./datatypes-schemas.qmd#ibis.expr.datatypes.DataType) or a string
An instance of [`DataType`](./datatypes.qmd#ibis.expr.datatypes.DataType) or a string
indicating the ibis type of `value`. This parameter can be used
in cases where ibis's type inference isn't sufficient for discovering
the type of `value`.
Expand Down

0 comments on commit 583af94

Please sign in to comment.