Skip to content

Commit

Permalink
332 remove bmds 2.7 (#6)
Browse files Browse the repository at this point in the history
* bmds3 collapse changes

* dueling formatters

* fixup gitlab actions?

---------

Co-authored-by: Andy Shapiro <[email protected]>
  • Loading branch information
hausman-gdit and shapiromatron committed Feb 12, 2024
1 parent 696efc7 commit 67ed923
Show file tree
Hide file tree
Showing 16 changed files with 34 additions and 38 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
steps:
- name: Checkout bmds-server
uses: actions/checkout@v3
- name: Checkout bmds@next
- name: Checkout bmds@main
uses: actions/checkout@v3
with:
repository: USEPA/bmds-private
path: venv
ref: next
ref: main
token: ${{ secrets.USEPA_BMDS_PRIVATE_PAT }}
- uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -55,8 +55,7 @@ jobs:
export "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/usr/lib"
sudo cp vendor/libnlopt.so /usr/local/lib/libnlopt.so.0
sudo ln -s /lib/x86_64-linux-gnu/libgsl.so /usr/local/lib/libgsl.so.25
export "BMD_DLL=$GITHUB_WORKSPACE/venv/bmds/bin/BMDS330/libDRBMD.so"
echo $BMD_DLL
export "BMD_DLL=$GITHUB_WORKSPACE/venv/bmds/bmdscore.cpython-*-x86_64-linux-gnu.so"
ldd $BMD_DLL
- name: lint
run: |
Expand Down Expand Up @@ -141,12 +140,12 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Checkout bmds@next
- name: Checkout bmds@main
uses: actions/checkout@v3
with:
repository: USEPA/bmds-private
path: venv
ref: next
ref: main
token: ${{ secrets.USEPA_BMDS_PRIVATE_PAT }}
- uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -176,8 +175,7 @@ jobs:
export "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/usr/lib"
sudo cp vendor/libnlopt.so /usr/local/lib/libnlopt.so.0
sudo ln -s /lib/x86_64-linux-gnu/libgsl.so /usr/local/lib/libgsl.so.25
export "BMD_DLL=$GITHUB_WORKSPACE/venv/bmds/bin/BMDS330/libDRBMD.so"
echo $BMD_DLL
export "BMD_DLL=$GITHUB_WORKSPACE/venv/bmds/bmdscore.cpython-*-x86_64-linux-gnu.so"
ldd $BMD_DLL
# https://github.community/t/how-to-retry-a-failed-step-in-github-actions-workflow/125880
- name: run integration tests
Expand Down
9 changes: 4 additions & 5 deletions bmds_server/analysis/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
from typing import NamedTuple, Self

import bmds
from bmds.bmds3.constants import DistType
from bmds.bmds3.models.multi_tumor import Multitumor, MultitumorBase
from bmds.bmds3.sessions import BmdsSession
from bmds.bmds3.types.nested_dichotomous import IntralitterCorrelation, LitterSpecificCovariate
from bmds.constants import ModelClass
from bmds.constants import DistType, ModelClass
from bmds.models.multi_tumor import Multitumor, MultitumorBase
from bmds.sessions import BmdsSession
from bmds.types.nested_dichotomous import IntralitterCorrelation, LitterSpecificCovariate

from .schema import AnalysisSessionSchema
from .transforms import (
Expand Down
6 changes: 3 additions & 3 deletions bmds_server/analysis/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
import bmds
import pandas as pd
import reversion
from bmds.bmds3.batch import BatchBase, BmdsSessionBatch, MultitumorBatch
from bmds.bmds3.recommender.recommender import RecommenderSettings
from bmds.bmds3.types.sessions import VersionSchema
from bmds.batch import BatchBase, BmdsSessionBatch, MultitumorBatch
from bmds.constants import ModelClass
from bmds.recommender.recommender import RecommenderSettings
from bmds.types.sessions import VersionSchema
from django.conf import settings
from django.core.cache import cache
from django.core.exceptions import ValidationError
Expand Down
3 changes: 1 addition & 2 deletions bmds_server/analysis/reporting/docx.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@

import docx
from bmds import __version__
from bmds.bmds3.reporting import write_setting_p
from bmds.datasets.transforms.polyk import PolyKAdjustment
from bmds.reporting.styling import Report
from bmds.reporting.styling import Report, write_setting_p
from django.conf import settings
from django.utils.timezone import now

Expand Down
2 changes: 1 addition & 1 deletion bmds_server/analysis/reporting/excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from typing import Any

import pandas as pd
from bmds.bmds3.sessions import BmdsSession
from bmds.constants import Dtype
from bmds.sessions import BmdsSession

from ..executor import AnalysisSession, MultiTumorSession

Expand Down
2 changes: 1 addition & 1 deletion bmds_server/analysis/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from io import StringIO

import pandas as pd
from bmds.bmds3.types.sessions import VersionSchema
from bmds.datasets.transforms.polyk import PolyKAdjustment
from bmds.types.sessions import VersionSchema
from pydantic import BaseModel, Field, field_validator
from rest_framework.schemas.openapi import SchemaGenerator

Expand Down
8 changes: 4 additions & 4 deletions bmds_server/analysis/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
from enum import StrEnum

import bmds
from bmds.bmds3.types.continuous import ContinuousModelSettings
from bmds.bmds3.types.dichotomous import DichotomousModelSettings
from bmds.bmds3.types.nested_dichotomous import NestedDichotomousModelSettings
from bmds.bmds3.types.priors import PriorClass
from bmds.constants import Dtype
from bmds.types.continuous import ContinuousModelSettings
from bmds.types.dichotomous import DichotomousModelSettings
from bmds.types.nested_dichotomous import NestedDichotomousModelSettings
from bmds.types.priors import PriorClass

from .validators.datasets import AdverseDirection

Expand Down
2 changes: 1 addition & 1 deletion bmds_server/analysis/validators/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from bmds.bmds3.recommender import RecommenderSettings
from bmds.recommender import RecommenderSettings

from ...common.validation import pydantic_validate
from .datasets import validate_datasets
Expand Down
8 changes: 4 additions & 4 deletions bmds_server/analysis/validators/options.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from typing import Any

import bmds
from bmds.bmds3.constants import DistType
from bmds.bmds3.types.continuous import ContinuousRiskType
from bmds.bmds3.types.dichotomous import DichotomousRiskType
from bmds.bmds3.types.nested_dichotomous import LitterSpecificCovariate
from bmds.constants import DistType
from bmds.types.continuous import ContinuousRiskType
from bmds.types.dichotomous import DichotomousRiskType
from bmds.types.nested_dichotomous import LitterSpecificCovariate
from django.conf import settings
from django.core.exceptions import ValidationError
from pydantic import BaseModel, Field
Expand Down
2 changes: 1 addition & 1 deletion bmds_server/analysis/validators/selectors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from bmds.bmds3.selected import SelectedModelSchema
from bmds.selected import SelectedModelSchema
from pydantic import BaseModel


Expand Down
2 changes: 1 addition & 1 deletion compose/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ USER app

ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

RUN ldd /usr/local/lib/python3.11/site-packages/bmds/bmdscore.cpython-311-x86_64-linux-gnu.so && \
RUN ldd /usr/local/lib/python3.11/site-packages/bmds/bmdscore.cpython-*-x86_64-linux-gnu.so && \
python /app/test.py
2 changes: 1 addition & 1 deletion compose/app/test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import bmds
from bmds.bmds3.models.dichotomous import Logistic
from bmds.models.dichotomous import Logistic

dataset = bmds.DichotomousDataset(
doses=[0, 50, 100, 150, 200], ns=[100, 100, 100, 100, 100], incidences=[0, 5, 30, 65, 90]
Expand Down
2 changes: 1 addition & 1 deletion tests/analysis/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import docx
import pandas as pd
import pytest
from bmds.bmds3.recommender import RecommenderSettings
from bmds.recommender import RecommenderSettings
from django.urls import reverse
from rest_framework.test import APIClient

Expand Down
4 changes: 2 additions & 2 deletions tests/analysis/test_executor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from copy import deepcopy

from bmds.bmds3.constants import ContinuousModelIds, DichotomousModelIds
from bmds.bmds3.types.priors import PriorClass
from bmds.constants import ContinuousModelIds, DichotomousModelIds
from bmds.types.priors import PriorClass

from bmds_server.analysis.executor import AnalysisSession

Expand Down
4 changes: 2 additions & 2 deletions tests/analysis/test_transforms.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import bmds
import pytest
from bmds.bmds3.types.continuous import ContinuousRiskType
from bmds.bmds3.types.dichotomous import DichotomousRiskType
from bmds.constants import M_Exponential, M_ExponentialM3, M_ExponentialM5
from bmds.types.continuous import ContinuousRiskType
from bmds.types.dichotomous import DichotomousRiskType

from bmds_server.analysis import transforms

Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pathlib import Path

import pytest
from bmds.bmds3.recommender import RecommenderSettings
from bmds.recommender import RecommenderSettings
from django.core.management import call_command


Expand Down

0 comments on commit 67ed923

Please sign in to comment.