@@ -148,34 +148,35 @@ patch release.
148
148
149
149
## Backwards Compatibility and Deprecation Policy
150
150
151
- PyGMT is still undergoing rapid development. All of the API is subject to change
152
- until the v1.0.0 release. Versioning in PyGMT is based on the
151
+ PyGMT is still undergoing rapid development. All of the API is subject to change until
152
+ the v1.0.0 release. Versioning in PyGMT is based on the
153
153
[ semantic versioning specification] ( https://semver.org/spec/v2.0.0.html )
154
- (i.e., v* MAJOR* .* MINOR* .* PATCH* ).
155
- Basic policy for backwards compatibility:
154
+ (i.e., v* MAJOR* .* MINOR* .* PATCH* ). Basic policy for backwards compatibility:
156
155
157
156
- Any incompatible changes should go through the deprecation process below.
158
- - Incompatible changes are only allowed in major and minor releases, not in
159
- patch releases.
157
+ - Incompatible changes are only allowed in major and minor releases, not in patch releases.
160
158
- Incompatible changes should be documented in the release notes.
161
159
162
160
When making incompatible changes, we should follow the process:
163
161
164
162
- Discuss whether the incompatible changes are necessary on GitHub.
165
- - Make the changes in a backwards compatible way, and raise a ` FutureWarning `
166
- warning for the old usage. At least one test using the old usage should be added.
167
- - The warning message should clearly explain the changes and include the versions
168
- in which the old usage is deprecated and is expected to be removed.
169
- - The ` FutureWarning ` warning should appear for 2-4 minor versions, depending on
170
- the impact of the changes. It means the deprecation period usually lasts
171
- 3-12 months.
163
+ - Make the changes in a backwards compatible way, and raise a ` FutureWarning ` warning
164
+ for the old usage. At least one test using the old usage should be added.
165
+ - The warning message should clearly explain the changes and include the versions in
166
+ which the old usage is deprecated and is expected to be removed.
167
+ - The ` FutureWarning ` warning should appear for 2-4 minor versions, depending on the
168
+ impact of the changes. It means the deprecation period usually lasts 3-12 months.
172
169
- Remove the old usage and warning when reaching the declared version.
173
170
174
- To rename a function parameter, add the ` @deprecate_parameter ` decorator near
175
- the top after the ` @fmt_docstring ` decorator but before the ` @use_alias `
176
- decorator (if those two exist). Here is an example:
171
+ ### Deprecating a function parameter
177
172
178
- ```
173
+ To rename a function parameter, add the ` @deprecate_parameter ` decorator near the top
174
+ after the ` @fmt_docstring ` decorator but before the ` @use_alias ` decorator (if those two
175
+ exist). A ` TODO ` comment should also be added to indicate the deprecation period (see below).
176
+ Here is an example:
177
+
178
+ ``` python
179
+ # TODO (PyGMT>=0.6.0): Remove the deprecated "columns" parameter.
179
180
@fmt_docstring
180
181
@deprecate_parameter (" columns" , " incols" , " v0.4.0" , remove_version = " v0.6.0" )
181
182
@use_alias (J = " projection" , R = " region" , V = " verbose" , i = " incols" )
@@ -184,8 +185,30 @@ def plot(self, x=None, y=None, data=None, size=None, direction=None, **kwargs):
184
185
pass
185
186
```
186
187
187
- In this case, the old parameter name ` columns ` is deprecated since v0.4.0, and
188
- will be fully removed in v0.6.0. The new parameter name is ` incols ` .
188
+ In this case, the old parameter name ` columns ` is deprecated since v0.4.0, and will be
189
+ fully removed in v0.6.0. The new parameter name is ` incols ` .
190
+
191
+ ### TODO comments
192
+
193
+ Occasionally, we need to implement temporary code that should be removed in the future.
194
+ This can occur in situations such as:
195
+
196
+ - When a parameter, function, or method is deprecated and scheduled for removal.
197
+ - When workarounds are necessary to address issues in older or upcoming versions of GMT
198
+ or other dependencies.
199
+
200
+ To track these temporary codes or workarounds, we use TODO comments. These comments
201
+ should adhere to the following format:
202
+
203
+ ``` python
204
+ # TODO (package>=X.Y.Z): A brief description of the TODO item.
205
+ # Additional details if necessary.
206
+ ```
207
+ The TODO comment indicates that we should address the item when * package* version
208
+ * X.Y.Z* or later is required.
209
+
210
+ It's important not to overuse TODO comments for tracking unimplemented features.
211
+ Instead, open issues to monitor these features.
189
212
190
213
191
214
## Making a Release
0 commit comments