Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix extrapad #83

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Fix extrapad #83

wants to merge 4 commits into from

Conversation

EythorE
Copy link

@EythorE EythorE commented Oct 10, 2023

In forestplot/graph_utils.py, extrapad was calculated as xlim[1] * (1 + extrapad) which becomes extremely large when effects are not close to 0.
These lines were refactored into a function _get_pad() which
uses the range xlim[1] - xlim[0] as reference to compute the pad, which fixes the issue.

Modified some of the code to work without internet connection.
Some of the code was trying to access csv's from https://github.com/LSYS/forestplot/tree/main/examples/data
those csv's are available as a part of this repo.
It now first checks if csvs are available in .[forestplot]/examples/data or a user provided Path else it access them through the url.

Tests did not work when working offline.
This was because forestplot.dataframe_utils.load_data
and forestplot.tests.test_plot.py were trying to access csv's from
https://github.com/LSYS/forestplot/tree/main/examples/data.
To fix this, a option for setting an environment variable FORESTPLOT_OFFLINE=1
and an argument data_path to forestplot.dataframe_utils.load_data was added.
This makes it possible to provide a path to the directory containing csv's to load_data
and setting FORESTPLOT_OFFLINE=1 makes it fail immediately if unsuccesful.
extrapad was calculated as xlim[1] * (1 + extrapad) which becomes extremely large when effects are not close to 0.
These lines were refactored into a function _get_pad() which
uses the range xlim[1] - xlim[0] as reference to compute the pad, which fixes the issue.
@EythorE EythorE marked this pull request as draft October 10, 2023 22:34
@sonarcloud
Copy link

sonarcloud bot commented Oct 10, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@EythorE EythorE marked this pull request as ready for review October 10, 2023 23:29
Copy link

sonarcloud bot commented Feb 9, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant