Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve function argument names in docs for a bunch of functions #448

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zeen
Copy link

@zeen zeen commented Nov 2, 2024

These now either match the source code (e.g., ST_MakeEnvelope()), or match the description in the docs (geom1, geom2).

@zeen zeen changed the title improve argument names for a bunch of functions improve function argument names in docs for a bunch of functions Nov 2, 2024
@Maxxen
Copy link
Member

Maxxen commented Nov 4, 2024

Hi! Thanks a lot for this PR and the help on improving the docs.
This should probably also be documented (ha), but the source-of-truth for the function reference is in the c++ files themselves, the markdown itself is generated by executing the generate_function_reference.py script in the root of the directory.

To add function parameter names for e.g. ST_MakeEnvelope you'd have to add

DocUtil::AddFunctionParameterNames(db, "ST_MakeEnvelope", {"min_x", "min_y", "max_x", "max_y"});

after the RegisterFunction call in e.g. src/spatial/core/functions/scalar/st_makeenvelope.cpp:58. Then recompile and execute the generate_funciton_reference.py script.

If this seems like a lot of effort feel free to leave this PR open as is and I will try to pick it up and incorporate the changes next time im working on spatial!

We're planning to rework this in the future so that all functions are declared separately with their names/parameters/types/overloads/descriptions/examples in e.g. json files from which we can generate both the markdown docs and scaffold the c++ stubs from.

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.

2 participants