Skip to content

Commit 63b46d4

Browse files
authored
[1.0] Remove deprecations
Merge pull request #460 from stan-dev/remove-deprecations
2 parents c83b739 + 78a8e9d commit 63b46d4

16 files changed

Lines changed: 21 additions & 464 deletions

.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ disable=bad-continuation,
7676
consider-using-with,
7777
consider-using-dict-items,
7878
unspecified-encoding,
79-
consider-using-f-string
79+
consider-using-f-string,
8080

8181
# Enable the message, report, category or checker with the given id(s). You can
8282
# either give multiple identifier separated by comma (,) or put this option

cmdstanpy/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
_CMDSTAN_SAMPLING = 1000
2323
_CMDSTAN_THIN = 1
2424
_CMDSTAN_REFRESH = 100
25-
_DOT_CMDSTANPY = '.cmdstanpy'
2625
_DOT_CMDSTAN = '.cmdstan'
2726

2827

cmdstanpy/cmdstan_args.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""
22
CmdStan arguments
33
"""
4-
import logging
54
import os
65
from enum import Enum, auto
76
from time import time
@@ -721,7 +720,6 @@ def __init__(
721720
save_latent_dynamics: bool = False,
722721
save_profile: bool = False,
723722
refresh: Optional[int] = None,
724-
logger: Optional[logging.Logger] = None,
725723
) -> None:
726724
"""Initialize object."""
727725
self.model_name = model_name
@@ -745,11 +743,6 @@ def __init__(
745743
elif isinstance(method_args, VariationalArgs):
746744
self.method = Method.VARIATIONAL
747745
self.method_args.validate(len(chain_ids) if chain_ids else None)
748-
if logger is not None:
749-
get_logger().warning(
750-
"Parameter 'logger' is deprecated."
751-
" Control logging behavior via logging.getLogger('cmdstanpy')"
752-
)
753746
self.validate()
754747

755748
def validate(self) -> None:

cmdstanpy/compiler_opts.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
Makefile options for stanc and C++ compilers
33
"""
44

5-
import logging
65
import os
76
from pathlib import Path
87
from typing import Any, Dict, List, Optional, Union
@@ -57,17 +56,11 @@ def __init__(
5756
stanc_options: Optional[Dict[str, Any]] = None,
5857
cpp_options: Optional[Dict[str, Any]] = None,
5958
user_header: Optional[str] = None,
60-
logger: Optional[logging.Logger] = None,
6159
) -> None:
6260
"""Initialize object."""
6361
self._stanc_options = stanc_options if stanc_options is not None else {}
6462
self._cpp_options = cpp_options if cpp_options is not None else {}
6563
self._user_header = user_header if user_header is not None else ''
66-
if logger is not None:
67-
get_logger().warning(
68-
"Parameter 'logger' is deprecated."
69-
" Control logging behavior via logging.getLogger('cmdstanpy')"
70-
)
7164

7265
def __repr__(self) -> str:
7366
return 'stanc_options={}, cpp_options={}'.format(

cmdstanpy/install_cmdstan.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@
3030

3131
from tqdm.auto import tqdm
3232

33-
from cmdstanpy import _DOT_CMDSTAN, _DOT_CMDSTANPY
33+
from cmdstanpy import _DOT_CMDSTAN
3434
from cmdstanpy.utils import (
3535
cmdstan_path,
3636
do_command,
37-
get_logger,
3837
pushd,
3938
validate_dir,
4039
wrap_url_progress_hook,
@@ -465,15 +464,6 @@ def main(args: Dict[str, Any]) -> None:
465464
)
466465

467466
cmdstan_dir = os.path.expanduser(os.path.join('~', _DOT_CMDSTAN))
468-
if not os.path.exists(cmdstan_dir):
469-
cmdstanpy_dir = os.path.expanduser(os.path.join('~', _DOT_CMDSTANPY))
470-
if os.path.exists(cmdstanpy_dir):
471-
cmdstan_dir = cmdstanpy_dir
472-
get_logger().warning(
473-
"Using ~/.cmdstanpy is deprecated and"
474-
" will not be automatically detected in version 1.0!\n"
475-
" Please rename to ~/.cmdstan"
476-
)
477467

478468
install_dir = cmdstan_dir
479469
if args['dir']:

cmdstanpy/install_cxx_toolchain.py

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@
2323
from time import sleep
2424
from typing import Any, Dict, List
2525

26-
from cmdstanpy import _DOT_CMDSTAN, _DOT_CMDSTANPY
26+
from cmdstanpy import _DOT_CMDSTAN
2727
from cmdstanpy.utils import (
28-
get_logger,
2928
pushd,
3029
validate_dir,
3130
wrap_url_progress_hook,
@@ -285,19 +284,7 @@ def main(args: Dict[str, Any]) -> None:
285284

286285
install_dir = args['dir']
287286
if install_dir is None:
288-
cmdstan_dir = os.path.expanduser(os.path.join('~', _DOT_CMDSTAN))
289-
if not os.path.exists(cmdstan_dir):
290-
cmdstanpy_dir = os.path.expanduser(
291-
os.path.join('~', _DOT_CMDSTANPY)
292-
)
293-
if os.path.exists(cmdstanpy_dir):
294-
cmdstan_dir = cmdstanpy_dir
295-
get_logger().warning(
296-
"Using ~/.cmdstanpy is deprecated and"
297-
" will not be automatically detected in version 1.0!\n"
298-
" Please rename to ~/.cmdstan"
299-
)
300-
install_dir = cmdstan_dir
287+
install_dir = os.path.expanduser(os.path.join('~', _DOT_CMDSTAN))
301288
validate_dir(install_dir)
302289
print('Install directory: {}'.format(install_dir))
303290

cmdstanpy/model.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""CmdStanModel"""
22

33
import io
4-
import logging
54
import os
65
import platform
76
import re
@@ -91,7 +90,6 @@ def __init__(
9190
stanc_options: Optional[Dict[str, Any]] = None,
9291
cpp_options: Optional[Dict[str, Any]] = None,
9392
user_header: Optional[str] = None,
94-
logger: Optional[logging.Logger] = None,
9593
) -> None:
9694
"""
9795
Initialize object given constructor args.
@@ -113,11 +111,6 @@ def __init__(
113111
cpp_options=cpp_options,
114112
user_header=user_header,
115113
)
116-
if logger is not None:
117-
get_logger().warning(
118-
"Parameter 'logger' is deprecated."
119-
" Control logging behavior via logging.getLogger('cmdstanpy')"
120-
)
121114

122115
if model_name is not None:
123116
if not model_name.strip():

0 commit comments

Comments
 (0)