Skip to content

Commit

Permalink
Merge pull request #165 from MassimoCimmino/issue160_deprecateOldAPI
Browse files Browse the repository at this point in the history
Issue160 deprecate old api
  • Loading branch information
MassimoCimmino authored Nov 10, 2021
2 parents 067b113 + f98b16d commit 0e67d4e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* [Issue 125](https://github.com/MassimoCimmino/pygfunction/issues/125) - Refactored class methods and docstrings in `Pipe` and `Network` objects to better represent the expected shapes of array inputs and outputs.
* [Issue 154](https://github.com/MassimoCimmino/pygfunction/issues/154) - Replaced `numpy.int` and `numpy.bool` dtypes in array initializations with built-in types `int` and `bool`. `numpy.int` and `numpy.bool` are deprecated as of `numpy` version `1.20`.
* [Issue 158](https://github.com/MassimoCimmino/pygfunction/issues/158) - Changed default parameter values for *g*-function calculations. The `gFunction` class now uses the `'equivalent'` solver by default and a non-uniform discretization of `nSegments=8` given by `utilities.segment_ratios()`.
* [Issue 160](https://github.com/MassimoCimmino/pygfunction/issues/160) - Deprecated functions `gfunction.uniform_heat_extraction`, `gfunction.uniform_temperature`, `gfunction.equal_inlet_temperature` and `gfunction.mixed_inlet_temperature`. They will be removed in `v3.0.0`.

### Bug fixes

Expand Down
28 changes: 28 additions & 0 deletions pygfunction/gfunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,13 @@ def uniform_heat_extraction(boreholes, time, alpha, use_similarities=True,
Journal of Heat and Mass Transfer, 70, 641-650.
"""
# This function is deprecated as of v2.1. It will be removed in v3.0.
warnings.warn("`pygfunction.gfunction.uniform_heat_extraction` is "
"deprecated as of v2.1. It will be removed in v3.0. "
"New features are not fully supported by the function. "
"Use the `pygfunction.gfunction.gFunction` class instead.",
DeprecationWarning)

boundary_condition = 'UHTR'
# Build options dict
options = {'nSegments':1,
Expand Down Expand Up @@ -981,6 +988,13 @@ def uniform_temperature(boreholes, time, alpha, nSegments=8,
Journal of Heat and Mass Transfer, 70, 641-650.
"""
# This function is deprecated as of v2.1. It will be removed in v3.0.
warnings.warn("`pygfunction.gfunction.uniform_temperature` is "
"deprecated as of v2.1. It will be removed in v3.0. "
"New features are not fully supported by the function. "
"Use the `pygfunction.gfunction.gFunction` class instead.",
DeprecationWarning)

boundary_condition = 'UBWT'
# Build options dict
options = {'nSegments':nSegments,
Expand Down Expand Up @@ -1080,6 +1094,13 @@ def equal_inlet_temperature(
fields. International Journal of Heat and Mass Transfer, 91, 1119-1127.
"""
# This function is deprecated as of v2.1. It will be removed in v3.0.
warnings.warn("`pygfunction.gfunction.equal_inlet_temperature` is "
"deprecated as of v2.1. It will be removed in v3.0. "
"New features are not fully supported by the function. "
"Use the `pygfunction.gfunction.gFunction` class instead.",
DeprecationWarning)

network = Network(
boreholes, UTubes, m_flow_network=m_flow_borehole*len(boreholes),
cp_f=cp_f, nSegments=nSegments)
Expand Down Expand Up @@ -1202,6 +1223,13 @@ def mixed_inlet_temperature(
Environment, 25 (8), 1007-1022
"""
# This function is deprecated as of v2.1. It will be removed in v3.0.
warnings.warn("`pygfunction.gfunction.mixed_inlet_temperature` is "
"deprecated as of v2.1. It will be removed in v3.0. "
"New features are not fully supported by the function. "
"Use the `pygfunction.gfunction.gFunction` class instead.",
DeprecationWarning)

boundary_condition = 'MIFT'
# Build options dict
options = {'nSegments':nSegments,
Expand Down

0 comments on commit 0e67d4e

Please sign in to comment.