|
4 | 4 | History |
5 | 5 | ======= |
6 | 6 |
|
| 7 | + |
| 8 | +v4.0.0 |
| 9 | +------ |
| 10 | + |
| 11 | +- Breaking changes |
| 12 | + |
| 13 | + - Following generalisation and standardisation of DOV object types regarding samples (monsters) and observations, |
| 14 | + there are changes in pydov too. Following datatypes are impacted: |
| 15 | + |
| 16 | + - Grondmonsters (borehole samples): removed |
| 17 | + |
| 18 | + ``pydov.search.grondmonster`` and ``pydov.types.grondmonster`` modules have been removed, in favor of the generic Monster type. |
| 19 | + Use :class:`pydov.search.monster` and :class:`pydov.types.monster` instead. |
| 20 | + Consult the available fields, fieldsets and subtypes in the :ref:`datasets section <dataset_monster>` |
| 21 | + and check the :doc:`tutorial <notebooks/search_monsters>` for more information and examples. |
| 22 | + |
| 23 | + - Preparing the pending deprecation of the Lambert72 coordinate reference system (CRS) (EPSG:31370), all locations and geometry return fields |
| 24 | + now require explicit CRS definition. This impacts: |
| 25 | + |
| 26 | + - :class:`pydov.util.location.Box` - add ``epsg=31370`` to specify Lambert72. |
| 27 | + - :class:`pydov.util.location.Point` - add ``epsg=31370`` to specify Lambert72. |
| 28 | + - :class:`pydov.util.location.GmlObject` - requires explicit `srsName`. |
| 29 | + - :class:`pydov.search.fields.GeometryReturnField` - add ``epsg=31370`` to specify Lambert72. |
| 30 | + |
| 31 | + For the same reason, it's no longer possible to reference a geometry return field by string reference, you have to use a GeometryReturnField instance |
| 32 | + from now on, explicitly defining the desired CRS. |
| 33 | + |
| 34 | + - Fields with an associated codelist now support both codes, labels and definitions. This means that they are no longer listed as `dict` in the output of ``get_fields()``, |
| 35 | + but are descedents of :class:`pydov.util.codelists.AbstractCodeList`. Codelists can originate from either a feature catalogue, an associated XSD type or (new) an OSLO |
| 36 | + codelist. If you want to add either the labels or the definitions to your output dataframes, you can use the ``get_label`` and ``get_definition`` methods, as |
| 37 | + explained in the :ref:`documentation <map_codelist>`. |
| 38 | + |
| 39 | + - Field classes restructuring: |
| 40 | + |
| 41 | + - The ``GeometryReturnField`` and ``ReturnField`` classes now reside inside the ``pydov.search.fields`` package instead of ``pydov.types.fields``, |
| 42 | + see :class:`pydov.search.fields.GeometryReturnField` and :class:`pydov.search.fields.ReturnField` |
| 43 | + |
| 44 | +- New features |
| 45 | + |
| 46 | + - Add support for extra fieldsets |
| 47 | + |
| 48 | + Starting from pydov 4, we support extra fieldsets for certain object types. These are fields that are not available in the the default output dataframes, |
| 49 | + but can easily be added should you need them. |
| 50 | + |
| 51 | + You can explore which fieldsets are available with the ``get_fieldsets()`` method on the main type:: |
| 52 | + |
| 53 | + from pydov.types.boring import Boring |
| 54 | + print(Boring.get_fieldsets()) |
| 55 | + |
| 56 | + You can add the fields from a fieldset to your search using the ``with_extra_fields()`` method:: |
| 57 | + |
| 58 | + from pydov.search.boring import BoringSearch |
| 59 | + from pydov.types.boring import MethodeXyz |
| 60 | + |
| 61 | + boring_search = BoringSearch(objecttype=Boring.with_extra_fields(MethodeXyz)) |
| 62 | + df = boring_search.search(max_features=10) |
| 63 | + print(df) |
| 64 | + |
| 65 | + More information can be found in the :ref:`customizing output <adding_extra_fields>` section. |
| 66 | + |
| 67 | + - Add support for extra subtypes |
| 68 | + |
| 69 | + We now also support multiple subtypes per main type. Most main types by default still have a subtype, but for some we also have other subtypes available. |
| 70 | + |
| 71 | + Check which subtypes are available with the ``get_subtypes()`` method on the main type:: |
| 72 | + |
| 73 | + from pydov.types.boring import Boring |
| 74 | + print(Boring.get_subtypes()) |
| 75 | + |
| 76 | + Use one of the subtypes in your search using the ``with_subtype()`` method:: |
| 77 | + |
| 78 | + from pydov.search.boring import BoringSearch |
| 79 | + from pydov.types.boring import Kleur |
| 80 | + |
| 81 | + boring_search = BoringSearch(objecttype=Boring.with_subtype(Kleur)) |
| 82 | + df = boring_search.search(max_features=10) |
| 83 | + print(df) |
| 84 | + |
| 85 | + More information can be found in the :ref:`customizing output <switching_subtypes>` section. |
| 86 | + |
| 87 | + - Monster (samples): added new type for generic Monster type |
| 88 | + |
| 89 | + Added a new object type for the generic Monster type. Check all available fields, fieldsets and subtypes in |
| 90 | + the :ref:`datasets section <dataset_monster>`. Consult the :doc:`tutorial <notebooks/search_monsters>` for more |
| 91 | + information and examples. |
| 92 | + |
| 93 | + - Added visual output for search instances and ``get_fields()`` output in Jupyter notebooks. |
| 94 | + |
| 95 | + Both search instances as well as the output of ``get_fields()`` and its subitems now support visualisation in Jupyter notebooks. |
| 96 | + To get a quick overview of a datatype, visualise its search instance:: |
| 97 | + |
| 98 | + from pydov.search.boring import BoringSearch |
| 99 | + BoringSearch() |
| 100 | + |
| 101 | + The output of ``get_fields()`` now supports both indexed as well as attribute-style access:: |
| 102 | + |
| 103 | + from pydov.search.boring import BoringSearch |
| 104 | + boring_search = BoringSearch() |
| 105 | + |
| 106 | + boring_search.get_fields()['methode']['codelist']['spade'] |
| 107 | + |
| 108 | + boring_search.get_fields().methode.codelist.spade |
| 109 | + |
| 110 | + This output is also available in the documentation tutorials, e.g. for :doc:`Boring <notebooks/search_boringen>`. |
| 111 | + |
| 112 | +- Documentation-only updates |
| 113 | + |
| 114 | + - Updated the documentation regarding object type customization with the newly introduced ``with_extra_fields()`` and ``with_subtype()`` methods. |
| 115 | + The old syntax should still be supported too. Check the new documentation :ref:`here <custom_object_types>`. |
| 116 | + |
| 117 | + |
| 118 | + |
7 | 119 | v3.3.1 |
8 | 120 | ------ |
9 | 121 |
|
|
0 commit comments