[Qgis-psc] PyQgis Cookbook revision

Alessandro Pasotti apasotti at gmail.com
Thu Dec 19 07:59:20 PST 2019


On Thu, Dec 19, 2019 at 4:41 PM Denis Rouzaud <denis.rouzaud at gmail.com>
wrote:

> Hi all,
>
> I was wondering if the cookbook could be integrated with the API docs
> website.
> It would be nice, we could test everything there (it uses the QGIS docker
> images), and it would have a single coherente endpoint.
>
> Ale, feel free to get in touch :)
>
> Denis
>

Hi Denis,

Do you you mean adding the cookbook directly in the C++ class headers? Like
https://github.com/qgis/QGIS/blob/master/src/server/qgsserverogcapi.h#L33 ?

This is what QT does, right?

If that's the case, I've thought about it and there are certainly some
advantages: the most important one would probably be a unique source for
code, API docs, PyQgis API docs and PyQgis recipes (the cookbook).
I'm not against it, but I'm not really sure it's the best option: I see the
cookbook more like a "book", where there might be more space for longer
paragraphs, pictures etc. and where the content can be organized
independently from the Qgs* classes structure.

There are also sections in the cookbook that span across classes (the
snippets mainly) or that do not really map to a single Qgs class.

In any event, the cookbook also uses a QGIS docker image for the python
code tests (qgis/qgis:latest).

But maybe I totally misunderstood your proposal and you are just talking
about moving the current cookbook content into another repo or suck it up
when building PyQGIS API docs.

Cheers


> Le jeu. 19 déc. 2019 à 16:04, Marco Bernasocchi <marco at qgis.org> a écrit :
>
>> Hi Alessandro, thanks a lot for the analysis, as I already mentioned in
>> the docs meeting I think the py cookbook is very important and needs lots
>> of love.
>>
>> I like your suggestion and I'd be in favour of doing it.
>>
>> cheers
>>
>> Marco
>> On 19.12.19 15:37, Alessandro Pasotti wrote:
>>
>>
>> On Wed, Dec 18, 2019 at 8:59 AM Paolo Cavallini <cavallini at faunalia.it>
>> wrote:
>>
>>> OK, if it's a quick thing then please submit a proposal and we'll vote
>>> it ASAP.
>>> Thanks.
>>>
>>
>> I've done a quick research, the current cookbook situation appears to be:
>>
>> - python code samples/snippets: 202
>> - python code samples/snippets currently tested: 53
>>
>> So, I think that the plan would be to:
>> 1. check all the cookbook text for 3.10 API changes and update it
>> accordingly
>> 2. put the 149 untested snippets under test
>>
>> As far as point 1 is concerned the following files have the 'outofdate'
>> directive:
>>
>> ./source/docs/pyqgis_developer_cookbook/server.rst
>> ./source/docs/pyqgis_developer_cookbook/settings.rst
>> ./source/docs/pyqgis_developer_cookbook/network_analysis.rst
>> ./source/docs/pyqgis_developer_cookbook/canvas.rst
>> ./source/docs/pyqgis_developer_cookbook/authentication.rst
>> ./source/docs/pyqgis_developer_cookbook/plugins/ide_debugging.rst
>> ./source/docs/pyqgis_developer_cookbook/plugins/pluginlayer.rst
>> ./source/docs/pyqgis_developer_cookbook/plugins/releasing.rst
>> ./source/docs/pyqgis_developer_cookbook/raster.rst
>>
>> this of course doesn't mean that all others are necessarily uptodate,
>> but we can assume that they require less work to be updated.
>>
>> It's a bit difficult to estimate the exact amount of work required to
>> achieve
>> both tasks, especially because some code samples will require quite a lot
>> of setup and data in order to run in the automatic tests.
>>
>> However, I think the most efficient way to proceed is to work on both
>> tasks simultaneously: while checking the code samples it will be easier
>> to also apply corrections to the text.
>>
>> So, what I would like to propose is to start with 5 days of work and see
>> where we
>> can get with that, there are probably some APIs that haven't changed much
>> between releases (authentication is an example).
>>
>> Btw, when looking at this, I've added this small improvement:
>> https://github.com/qgis/QGIS-Documentation/pull/4651
>>
>> Cheers
>>
>>
>>
>>> Il 18/12/19 08:57, Alessandro Pasotti ha scritto:
>>> >
>>> >
>>> > On Wed, Dec 18, 2019 at 8:54 AM Paolo Cavallini <cavallini at faunalia.it
>>> > <mailto:cavallini at faunalia.it>> wrote:
>>> >
>>> >     Hi Ale,
>>> >     would this be suitable for a grant project?
>>> >
>>> >
>>> >
>>> > You tell me :)
>>> >
>>> > I thought I would have time to do it now in the next few weeks, but if
>>> I
>>> > will still have time later in the year I will apply for a grant.
>>> >
>>> > Cheers
>>> >
>>> >     Cheers.
>>> >
>>> >     Il 18/12/19 08:50, Alessandro Pasotti ha scritto:
>>> >     > Hi,
>>> >     >
>>> >     > I'd like like to make a deep revision and update of the cookbook
>>> >     and put
>>> >     > code snippets under automated testing.
>>> >     >
>>> >     > Are there any funds left for such activity?
>>> >     >
>>> >     > --
>>> >     > Alessandro Pasotti
>>> >     > w3:   www.itopen.it <http://www.itopen.it> <http://www.itopen.it
>>> >
>>> >     >
>>> >     > _______________________________________________
>>> >     > Qgis-psc mailing list
>>> >     > Qgis-psc at lists.osgeo.org <mailto:Qgis-psc at lists.osgeo.org>
>>> >     > https://lists.osgeo.org/mailman/listinfo/qgis-psc
>>> >     >
>>> >
>>> >     --
>>> >     Paolo Cavallini - www.faunalia.eu <http://www.faunalia.eu>
>>> >     QGIS.ORG <http://QGIS.ORG> Chair:
>>> >     http://planet.qgis.org/planet/user/28/tag/qgis%20board/
>>> >     _______________________________________________
>>> >     Qgis-psc mailing list
>>> >     Qgis-psc at lists.osgeo.org <mailto:Qgis-psc at lists.osgeo.org>
>>> >     https://lists.osgeo.org/mailman/listinfo/qgis-psc
>>> >
>>> >
>>> >
>>> > --
>>> > Alessandro Pasotti
>>> > w3:   www.itopen.it <http://www.itopen.it>
>>>
>>> --
>>> Paolo Cavallini - www.faunalia.eu
>>> QGIS.ORG Chair:
>>> http://planet.qgis.org/planet/user/28/tag/qgis%20board/
>>>
>>
>>
>> --
>> Alessandro Pasotti
>> w3:   www.itopen.it
>>
>> _______________________________________________
>> Qgis-psc mailing listQgis-psc at lists.osgeo.orghttps://lists.osgeo.org/mailman/listinfo/qgis-psc
>>
>> --
>> Marco Bernasocchi
>>
>> QGIS.org Co-chairhttp://berna.io
>>
>> _______________________________________________
>> Qgis-psc mailing list
>> Qgis-psc at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/qgis-psc
>
>

-- 
Alessandro Pasotti
w3:   www.itopen.it
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-psc/attachments/20191219/49d2c30a/attachment.html>


More information about the Qgis-psc mailing list