Skip to content

Commit d476eba

Browse files
authored
Polishing (#527)
1 parent 95891f5 commit d476eba

File tree

12 files changed

+69
-120
lines changed

12 files changed

+69
-120
lines changed

.github/workflows/publish-to-pypi.yml

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: PyPI
33
on: push
44
jobs:
5-
build-n-publish-optimagic:
5+
build-n-publish:
66
name: Build and publish optimagic Python 🐍 distributions 📦 to PyPI
77
runs-on: ubuntu-latest
88
steps:
@@ -29,37 +29,3 @@ jobs:
2929
uses: pypa/gh-action-pypi-publish@release/v1
3030
with:
3131
password: ${{ secrets.PYPI_API_TOKEN_OPTIMAGIC }}
32-
build-n-publish-estimagic:
33-
name: Build and publish estimagic Python 🐍 distributions 📦 to PyPI
34-
runs-on: ubuntu-latest
35-
steps:
36-
- uses: actions/checkout@v4
37-
- name: Set up Python 3.10
38-
uses: actions/setup-python@v5
39-
with:
40-
python-version: '3.10'
41-
- name: Install pypa/build
42-
run: >-
43-
python -m
44-
pip install
45-
build
46-
toml
47-
--user
48-
- name: Set name entry in pyproject.toml to estimagic
49-
run: >-
50-
python .tools/update_name_pyproject.py
51-
- name: Add FutureWarning to init files
52-
run: >-
53-
python .tools/update_init_files.py
54-
- name: Build a binary wheel and a source tarball
55-
run: >-
56-
python -m
57-
build
58-
--sdist
59-
--wheel
60-
--outdir dist/
61-
- name: Publish distribution 📦 to PyPI
62-
if: startsWith(github.ref, 'refs/tags')
63-
uses: pypa/gh-action-pypi-publish@release/v1
64-
with:
65-
password: ${{ secrets.PYPI_API_TOKEN }}

.tools/update_init_files.py

Lines changed: 0 additions & 29 deletions
This file was deleted.

.tools/update_name_pyproject.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

CHANGES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This is a record of all past optimagic releases and what went into them in reverse
44
chronological order. We follow [semantic versioning](https://semver.org/) and all
5-
releases are available on [Anaconda.org](https://anaconda.org/OpenSourceEconomics/optimagic).
5+
releases are available on [Anaconda.org](https://anaconda.org/optimagic-dev/optimagic).
66

77
Following the [scientific python guidelines](https://scientific-python.org/specs/spec-0000/)
88
we drop the official support for Python 3.9.

CITATION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11

2-
Please use one of the following samples to cite the estimagic version (change
2+
Please use one of the following samples to cite the optimagic version (change
33
x.y) from this installation
44

55
Text:
66

77
[optimagic] optimagic x.y, 2024
8-
Janos Gabler, https://github.com/OpenSourceEconomics/optimagic
8+
Janos Gabler, https://github.com/optimagic-dev/optimagic
99

1010
BibTeX:
1111

1212
@Unpublished{Gabler2024,
1313
Title = {optimagic: A library for nonlinear optimization},
1414
Author = {Janos Gabler},
1515
Year = {2024},
16-
Url = {https://github.com/OpenSourceEconomics/optimagic}
16+
Url = {https://github.com/optimagic-dev/optimagic}
1717
}
1818

1919
If you are unsure about which version of optimagic you are using run: `conda list optimagic`.

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# optimagic
22

33
![PyPI - Version](https://img.shields.io/pypi/v/optimagic)
4-
[![image](https://img.shields.io/pypi/pyversions/estimagic)](https://pypi.org/project/estimagic)
5-
[![image](https://img.shields.io/conda/vn/conda-forge/estimagic.svg)](https://anaconda.org/conda-forge/estimagic)
6-
[![image](https://img.shields.io/conda/pn/conda-forge/estimagic.svg)](https://anaconda.org/conda-forge/estimagic)
7-
[![image](https://img.shields.io/pypi/l/estimagic)](https://pypi.org/project/estimagic)
8-
[![image](https://readthedocs.org/projects/estimagic/badge/?version=latest)](https://estimagic.readthedocs.io/en/latest)
9-
[![image](https://img.shields.io/github/actions/workflow/status/OpenSourceEconomics/estimagic/main.yml?branch=main)](https://github.com/OpenSourceEconomics/estimagic/actions?query=branch%3Amain)
10-
[![image](https://codecov.io/gh/OpenSourceEconomics/estimagic/branch/main/graph/badge.svg)](https://codecov.io/gh/OpenSourceEconomics/optimagic)
11-
[![image](https://results.pre-commit.ci/badge/github/OpenSourceEconomics/estimagic/main.svg)](https://github.com/OpenSourceEconomics/optimagic/actions?query=branch%3Amain)
12-
[![image](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
4+
[![image](https://img.shields.io/pypi/pyversions/optimagic)](https://pypi.org/project/optimagic)
5+
[![image](https://img.shields.io/conda/vn/conda-forge/optimagic.svg)](https://anaconda.org/conda-forge/optimagic)
6+
[![image](https://img.shields.io/conda/pn/conda-forge/optimagic.svg)](https://anaconda.org/conda-forge/optimagic)
7+
[![image](https://img.shields.io/pypi/l/optimagic)](https://pypi.org/project/optimagic)
8+
[![image](https://readthedocs.org/projects/optimagic/badge/?version=latest)](https://optimagic.readthedocs.io/en/latest)
9+
[![image](https://img.shields.io/github/actions/workflow/status/optimagic-dev/optimagic/main.yml?branch=main)](https://github.com/optimagic-dev/optimagic/actions?query=branch%3Amain)
10+
[![image](https://codecov.io/gh/optimagic-dev/optimagic/branch/main/graph/badge.svg)](https://codecov.io/gh/optimagic-dev/optimagic)
11+
[![image](https://results.pre-commit.ci/badge/github/optimagic-dev/optimagic/main.svg)](https://results.pre-commit.ci/latest/github/optimagic-dev/optimagic/main)
12+
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
1313
[![image](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)
14-
[![image](https://pepy.tech/badge/estimagic/month)](https://pepy.tech/project/estimagic)
14+
[![image](https://pepy.tech/badge/optimagic/month)](https://pepy.tech/project/optimagic)
1515
[![image](https://img.shields.io/badge/NumFOCUS-affiliated%20project-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](https://numfocus.org/sponsored-projects/affiliated-projects)
1616
[![image](https://img.shields.io/twitter/follow/aiidateam.svg?style=social&label=Follow)](https://x.com/optimagic)
1717

@@ -86,7 +86,7 @@ If you use optimagic for your research, please do not forget to cite it.
8686
Title = {optimagic: A library for nonlinear optimization},
8787
Author = {Janos Gabler},
8888
Year = {2022},
89-
Url = {https://github.com/OpenSourceEconomics/optimagic}
89+
Url = {https://github.com/optimagic-dev/optimagic}
9090
}
9191
```
9292

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181

8282
extlinks = {
8383
"ghuser": ("https://github.com/%s", "@"),
84-
"gh": ("https://github.com/OpenSourceEconomics/optimagic/pulls/%s", "#"),
84+
"gh": ("https://github.com/optimagic-dev/optimagic/pulls/%s", "#"),
8585
}
8686

8787
intersphinx_mapping = {

docs/source/development/how_to_contribute.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ ideas and guide the development process from the beginning. You can start a conv
1313
by posting an issue on GitHub or by emailing [janosg](https://github.com/janosg).
1414

1515
To get familiar with the codebase, we recommend checking out our
16-
[issue tracker](https://github.com/OpenSourceEconomics/optimagic/issues) for some
17-
immediate and clearly defined tasks.
16+
[issue tracker](https://github.com/optimagic-dev/optimagic/issues) for some immediate
17+
and clearly defined tasks.
1818

1919
## 2. Before you start
2020

@@ -30,11 +30,11 @@ contribution process (see Notes below).
3030

3131
## 3. Step-by-step guide
3232

33-
1. Fork the [optimagic repository](https://github.com/OpenSourceEconomics/optimagic/).
34-
This action creates a copy of the repository with write access for you.
33+
1. Fork the [optimagic repository](https://github.com/optimagic-dev/optimagic/). This
34+
action creates a copy of the repository with write access for you.
3535

3636
```{note}
37-
For regular contributors: **Clone** the [repository](https://github.com/OpenSourceEconomics/optimagic/) to your local machine and create a new branch for implementing your changes. You can push your branch directly to the remote optimagic repository and open a PR from there.
37+
For regular contributors: **Clone** the [repository](https://github.com/optimagic-dev/optimagic/) to your local machine and create a new branch for implementing your changes. You can push your branch directly to the remote optimagic repository and open a PR from there.
3838
```
3939

4040
2. Clone your forked repository to your disk. This is where you'll make all your
@@ -110,7 +110,7 @@ Skip the next paragraph if you haven't worked on the documentation.
110110
```
111111

112112
Follow the steps outlined in the optimagic
113-
[PR template](https://github.com/OpenSourceEconomics/optimagic/blob/main/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md)
113+
[PR template](https://github.com/optimagic-dev/optimagic/blob/main/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md)
114114
to describe your contribution, the problem it addresses, and your proposed solution.
115115

116116
Opening a PR initiates a complete CI run, including the `pytest` suite, linters, code

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ content-type = "text/markdown"
6060
text = "MIT"
6161

6262
[project.urls]
63-
Repository = "https://github.com/opensourceeconomics/optimagic"
64-
Github = "https://github.com/opensourceeconomics/optimagic"
65-
Tracker = "https://github.com/OpenSourceEconomics/optimagic/issues"
63+
Repository = "https://github.com/optimagic-dev/optimagic"
64+
Github = "https://github.com/optimagic-dev/optimagic"
65+
Tracker = "https://github.com/optimagic-dev/optimagic/issues"
6666

6767

6868
# ======================================================================================

src/optimagic/deprecations.py

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ def throw_derivative_future_warning():
4545
msg = (
4646
"To align optimagic with scipy.optimize, the `derivative` argument has been "
4747
"renamed to `jac`. Please use `jac` instead of `derivative`. Using `derivative`"
48-
" will become an error in optimagic version 0.6.0 and later."
48+
" will become an error in optimagic version 0.6.0 and later. For more details "
49+
"see the documentation: "
50+
"https://optimagic.readthedocs.io/en/latest/how_to/how_to_derivatives.html"
4951
)
5052
warnings.warn(msg, FutureWarning)
5153

@@ -55,7 +57,8 @@ def throw_derivative_kwargs_future_warning():
5557
"To align optimagic with scipy.optimize, the `derivative_kwargs` argument has "
5658
"been renamed to `jac_kwargs`. Please use `jac_kwargs` instead of "
5759
"`derivative_kwargs`. Using `derivative_kwargs` will become an error in "
58-
"optimagic version 0.6.0 and later."
60+
"optimagic version 0.6.0 and later. For more details see the documentation: "
61+
"https://optimagic.readthedocs.io/en/latest/how_to/how_to_derivatives.html"
5962
)
6063
warnings.warn(msg, FutureWarning)
6164

@@ -65,7 +68,9 @@ def throw_criterion_and_derivative_future_warning():
6568
"To align optimagic with scipy.optimize, the `criterion_and_derivative` "
6669
"argument has been renamed to `fun_and_jac`. Please use `fun_and_jac` "
6770
"instead of `criterion_and_derivative`. Using `criterion_and_derivative` "
68-
"will become an error in optimagic version 0.6.0 and later."
71+
"will become an error in optimagic version 0.6.0 and later. For more details "
72+
"see the documentation: "
73+
"https://optimagic.readthedocs.io/en/latest/how_to/how_to_derivatives.html"
6974
)
7075
warnings.warn(msg, FutureWarning)
7176

@@ -76,7 +81,8 @@ def throw_criterion_and_derivative_kwargs_future_warning():
7681
"argument has been renamed to `fun_and_jac_kwargs`. Please use "
7782
"`fun_and_jac_kwargs` instead of `criterion_and_derivative_kwargs`. Using "
7883
"`criterion_and_derivative_kwargs` will become an error in optimagic version "
79-
"0.6.0 and later."
84+
"0.6.0 and later. For more details see the documentation: "
85+
"https://optimagic.readthedocs.io/en/latest/how_to/how_to_derivatives.html"
8086
)
8187
warnings.warn(msg, FutureWarning)
8288

@@ -94,7 +100,9 @@ def throw_multistart_options_future_warning():
94100
msg = (
95101
"Specifying multistart options via the argument `multistart_options` is "
96102
"deprecated and will be removed in optimagic version 0.6.0 and later. You can "
97-
"pass these options directly to the `multistart` argument instead."
103+
"pass these options directly to the `multistart` argument instead. For more "
104+
"details see the documentation: "
105+
"https://optimagic.readthedocs.io/en/latest/how_to/how_to_multistart.html"
98106
)
99107
warnings.warn(msg, FutureWarning)
100108

@@ -279,7 +287,8 @@ def throw_dict_output_warning():
279287
"0.6.0 and later. Please use the optimagic.mark.scalar, optimagic.mark."
280288
"least_squares, or optimagic.mark.likelihood decorators to indicate the type "
281289
"of problem you are solving. Use optimagic.FunctionValue objects to return "
282-
"additional information for the logging."
290+
"additional information for the logging. Please see the documentation for more "
291+
"details: https://optimagic.readthedocs.io/en/latest/how_to/how_to_criterion_function.html"
283292
)
284293
warnings.warn(msg, FutureWarning)
285294

@@ -367,6 +376,10 @@ def throw_dict_constraints_future_warning_if_required(
367376
)
368377
for t in types:
369378
msg += f" {{'type': '{t}', ...}} -> {replacements[t]}(...)\n"
379+
msg += (
380+
"\nFor more details see the documentation: "
381+
"https://optimagic.readthedocs.io/en/latest/how_to/how_to_constraints.html"
382+
)
370383

371384
warnings.warn(msg, FutureWarning)
372385

@@ -387,14 +400,17 @@ def replace_and_warn_about_deprecated_multistart_options(options):
387400
msg = (
388401
"The `share_optimization` option is deprecated and will be removed in "
389402
"version 0.6.0. Use `stopping_maxopt` instead to specify the number of "
390-
"optimizations directly."
403+
"optimizations directly. For more details see the documentation: "
404+
"https://optimagic.readthedocs.io/en/latest/how_to/how_to_multistart.html"
391405
)
392406
warnings.warn(msg, FutureWarning)
393407

394408
if options.convergence_relative_params_tolerance is not None:
395409
msg = (
396410
"The `convergence_relative_params_tolerance` option is deprecated and will "
397-
"be removed in version 0.6.0. Use `convergence_xtol_rel` instead."
411+
"be removed in version 0.6.0. Use `convergence_xtol_rel` instead. For more "
412+
"details see the documentation: "
413+
"https://optimagic.readthedocs.io/en/latest/how_to/how_to_convergence.html"
398414
)
399415
warnings.warn(msg, FutureWarning)
400416
if options.convergence_xtol_rel is None:
@@ -407,7 +423,9 @@ def replace_and_warn_about_deprecated_multistart_options(options):
407423
"The `optimization_error_handling` option is deprecated and will be "
408424
"removed in version 0.6.0. Setting this attribute also sets the error "
409425
"handling for exploration. Use the new `error_handling` option to set the "
410-
"error handling for both optimization and exploration."
426+
"error handling for both optimization and exploration. For more details "
427+
"see the documentation: "
428+
"https://optimagic.readthedocs.io/en/latest/how_to/how_to_error_handling.html"
411429
)
412430
warnings.warn(msg, FutureWarning)
413431
if options.error_handling is None:
@@ -418,7 +436,9 @@ def replace_and_warn_about_deprecated_multistart_options(options):
418436
"The `exploration_error_handling` option is deprecated and will be "
419437
"removed in version 0.6.0. Setting this attribute also sets the error "
420438
"handling for exploration. Use the new `error_handling` option to set the "
421-
"error handling for both optimization and exploration."
439+
"error handling for both optimization and exploration. For more details "
440+
"see the documentation: "
441+
"https://optimagic.readthedocs.io/en/latest/how_to/how_to_error_handling.html"
422442
)
423443
warnings.warn(msg, FutureWarning)
424444
if options.error_handling is None:
@@ -435,7 +455,9 @@ def replace_and_warn_about_deprecated_base_steps(
435455
msg = (
436456
"The `base_steps` argument is deprecated and will be removed alongside "
437457
"Richardson extrapolation in optimagic version 0.6.0. To specify the "
438-
"step size use the `step_size` argument instead."
458+
"step size use the `step_size` argument instead. For more details see the "
459+
"documentation: "
460+
"https://optimagic.readthedocs.io/en/latest/how_to/how_to_step_size.html"
439461
)
440462
warnings.warn(msg, FutureWarning)
441463

@@ -448,10 +470,11 @@ def replace_and_warn_about_deprecated_base_steps(
448470
def replace_and_warn_about_deprecated_derivatives(candidate, name):
449471
msg = (
450472
f"Specifying a dictionary of {name} functions is deprecated and will be "
451-
"removed in optimagic version 0.6.0. Please specify a single function that has "
473+
"removed in optimagic version 0.6.0. Please specify a single function that "
452474
"returns the correct derivative for your optimizer or a list of functions that "
453475
"are decorated with the `mark.scalar`, `mark.likelihood` or "
454-
"`mark.least_squares` decorators."
476+
"`mark.least_squares` decorators. For more details see the documentation: "
477+
"https://optimagic.readthedocs.io/en/latest/how_to/how_to_derivatives.html"
455478
)
456479
warnings.warn(msg, FutureWarning)
457480

@@ -552,7 +575,9 @@ def pre_process_constraints(
552575
else:
553576
msg = (
554577
f"Invalid constraint type: {type(constraints)}. Must be a constraint "
555-
"object or list thereof imported from `optimagic`."
578+
"object or list thereof imported from `optimagic`. For more details see "
579+
"the documentation: "
580+
"https://optimagic.readthedocs.io/en/latest/how_to/how_to_constraints.html"
556581
)
557582
raise InvalidConstraintError(msg)
558583

0 commit comments

Comments
 (0)