Skip to content

Commit

Permalink
Merge branch 'main' into change-naming
Browse files Browse the repository at this point in the history
  • Loading branch information
J535D165 committed Sep 28, 2024
2 parents 1d10ecb + a552978 commit 31012f8
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 21 deletions.
23 changes: 10 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.272
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: ruff
- repo: https://github.com/psf/black
rev: 23.3.0
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.8
hooks:
- id: black
- id: ruff
- id: ruff-format
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,4 @@ Copyright 2020 The ASReview Authors. All rights reserved.
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
13 changes: 10 additions & 3 deletions asreviewcontrib/insights/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,16 +423,23 @@ def _add_optimal_curve(ax, labels, x_absolute, y_absolute):
n_docs = len(labels)

# Create x and y arrays for step plot
x = np.arange(0, n_pos_docs + 1) if x_absolute else np.arange(0, n_pos_docs + 1) / n_docs # noqa: E501
y = np.arange(0, n_pos_docs + 1) if y_absolute else np.arange(0, n_pos_docs + 1) / n_pos_docs # noqa: E501
x = (
np.arange(0, n_pos_docs + 1)
if x_absolute
else np.arange(0, n_pos_docs + 1) / n_docs
)
y = (
np.arange(0, n_pos_docs + 1)
if y_absolute
else np.arange(0, n_pos_docs + 1) / n_pos_docs
)

# Plot the stepwise optimal curve
ax.step(x, y, color="grey", where="post")

return ax



def _add_wss_curve(ax, labels, x_absolute=False, y_absolute=False, legend_label=None):
x, y = _wss_values(labels, x_absolute=x_absolute, y_absolute=y_absolute)
ax.step(x, y, where="post", label=legend_label)
Expand Down
1 change: 0 additions & 1 deletion docs/stats_explainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
python docs/stats_explainer.py
"""


import matplotlib.pyplot as plt
import numpy as np

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ packages = ["asreviewcontrib"]
[tool.setuptools_scm]
write_to = "asreviewcontrib/insights/_version.py"

[tool.ruff]
[tool.ruff.lint]
select = ["E", "F", "UP", "I", "B"]

[tool.ruff.isort]
[tool.ruff.lint.isort]
force-single-line = true
2 changes: 1 addition & 1 deletion tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
```
asreview simulate benchmark:van_de_schoot_2017 -s sim_van_de_schoot_2017_stop_if_min.asreview --init_seed 535 --seed 400 --stop_if min
asreview simulate benchmark:van_de_schoot_2017 -s sim_van_de_schoot_2017_stop_if_full.asreview --init_seed 535 --seed 400 --stop_if -1
```
```

0 comments on commit 31012f8

Please sign in to comment.