Issue: Simulation step done in run_amd(), but failed to output final result csv-file and html-file due to failed vpc plotting. Input dataset for amd: /crex/proj/pmgroup_active_storage/private/users/yahan/AMD/Barbara/simdata1.csv. Pandas version was 2.2.3.
Error message:
ValueError: Bin edges must be unique: Index([0.0, 0.0, 0.5, 1.0, 2.0, 3.0, 4.0, 6.0, 24.0], dtype='float64').
You can drop duplicate edges by setting the 'duplicates' kwarg
Run reticulate::py_last_error() for details.ValueErrorBin edges must be unique: Index([0.0, 0.0, 0.5, 1.0, 2.0, 3.0, 4.0, 6.0, 24.0], dtype='float64').
You can drop duplicate edges by setting the 'duplicates' kwargc(" File \"/domus/h1/yahs1790/.virtualenvs/pharmpy_12/lib/python3.12/site-packages/pharmpy/tools/amd/run.py\", line 611, in run_amd\n final_vpc_plot = plot_vpc(final_model, simulation_data, stratify_on=dvid_name)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", " File \"/domus/h1/yahs1790/.virtualenvs/pharmpy_12/lib/python3.12/site-packages/pharmpy/modeling/plots.py\", line 1030, in plot_vpc\n chart = _vpc_plot(model, simulations, binning=binning, nbins=nbins, qi=qi, ci=ci)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
" File \"/domus/h1/yahs1790/.virtualenvs/pharmpy_12/lib/python3.12/site-packages/pharmpy/modeling/plots.py\", line 840, in _vpc_plot\n df = _calculate_vpc(\n ^^^^^^^^^^^^^^^\n", " File \"/domus/h1/yahs1790/.virtualenvs/pharmpy_12/lib/python3.12/site-packages/pharmpy/modeling/plots.py\", line 729, in _calculate_vpc\n bincol, boundaries = bin_observations(model, binning, nbins)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", " File \"/domus/h1/yahs1790/.virtualenvs/pharmpy_12/lib/python3.12/site-packages/pharmpy/modeling/data.py\", line 2320, in bin_observations\n bincol, boundaries = pd.cut(\n ^^^^^^^\n",
" File \"/domus/h1/yahs1790/.virtualenvs/pharmpy_12/lib/python3.12/site-packages/pandas/core/reshape/tile.py\", line 257, in cut\n fac, bins = _bins_to_cuts(\n ^^^^^^^^^^^^^^\n", " File \"/domus/h1/yahs1790/.virtualenvs/pharmpy_12/lib/python3.12/site-packages/pandas/core/reshape/tile.py\", line 443, in _bins_to_cuts\n raise ValueError(\n")Traceback (most recent call last):
File "/domus/h1/yahs1790/.virtualenvs/pharmpy_12/lib/python3.12/site-packages/pharmpy/tools/amd/run.py", line 611, in run_amd
final_vpc_plot = plot_vpc(final_model, simulation_data, stratify_on=dvid_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/domus/h1/yahs1790/.virtualenvs/pharmpy_12/lib/python3.12/site-packages/pharmpy/modeling/plots.py", line 1030, in plot_vpc
chart = _vpc_plot(model, simulations, binning=binning, nbins=nbins, qi=qi, ci=ci)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/domus/h1/yahs1790/.virtualenvs/pharmpy_12/lib/python3.12/site-packages/pharmpy/modeling/plots.py", line 840, in _vpc_plot
df = _calculate_vpc(
^^^^^^^^^^^^^^^
File "/domus/h1/yahs1790/.virtualenvs/pharmpy_12/lib/python3.12/site-packages/pharmpy/modeling/plots.py", line 729, in _calculate_vpc
bincol, boundaries = bin_observations(model, binning, nbins)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/domus/h1/yahs1790/.virtualenvs/pharmpy_12/lib/python3.12/site-packages/pharmpy/modeling/data.py", line 2320, in bin_observations
bincol, boundaries = pd.cut(
^^^^^^^
File "/domus/h1/yahs1790/.virtualenvs/pharmpy_12/lib/python3.12/site-packages/pandas/core/reshape/tile.py", line 257, in cut
fac, bins = _bins_to_cuts(
^^^^^^^^^^^^^^
File "/domus/h1/yahs1790/.virtualenvs/pharmpy_12/lib/python3.12/site-packages/pandas/core/reshape/tile.py", line 443, in _bins_to_cuts
raise ValueError(
ValueError: Bin edges must be unique: Index([0.0, 0.0, 0.5, 1.0, 2.0, 3.0, 4.0, 6.0, 24.0], dtype='float64').
You can drop duplicate edges by setting the 'duplicates' kwarg
Bug report
Pharmpy version: 1.3.0
Issue: Simulation step done in
run_amd()
, but failed to output final result csv-file and html-file due to failed vpc plotting. Input dataset for amd: /crex/proj/pmgroup_active_storage/private/users/yahan/AMD/Barbara/simdata1.csv. Pandas version was 2.2.3.Error message: ValueError: Bin edges must be unique: Index([0.0, 0.0, 0.5, 1.0, 2.0, 3.0, 4.0, 6.0, 24.0], dtype='float64'). You can drop duplicate edges by setting the 'duplicates' kwarg Run
reticulate::py_last_error()
for details.ValueErrorBin edges must be unique: Index([0.0, 0.0, 0.5, 1.0, 2.0, 3.0, 4.0, 6.0, 24.0], dtype='float64'). You can drop duplicate edges by setting the 'duplicates' kwargc(" File \"/domus/h1/yahs1790/.virtualenvs/pharmpy_12/lib/python3.12/site-packages/pharmpy/tools/amd/run.py\", line 611, in run_amd\n final_vpc_plot = plot_vpc(final_model, simulation_data, stratify_on=dvid_name)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", " File \"/domus/h1/yahs1790/.virtualenvs/pharmpy_12/lib/python3.12/site-packages/pharmpy/modeling/plots.py\", line 1030, in plot_vpc\n chart = _vpc_plot(model, simulations, binning=binning, nbins=nbins, qi=qi, ci=ci)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", " File \"/domus/h1/yahs1790/.virtualenvs/pharmpy_12/lib/python3.12/site-packages/pharmpy/modeling/plots.py\", line 840, in _vpc_plot\n df = _calculate_vpc(\n ^^^^^^^^^^^^^^^\n", " File \"/domus/h1/yahs1790/.virtualenvs/pharmpy_12/lib/python3.12/site-packages/pharmpy/modeling/plots.py\", line 729, in _calculate_vpc\n bincol, boundaries = bin_observations(model, binning, nbins)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", " File \"/domus/h1/yahs1790/.virtualenvs/pharmpy_12/lib/python3.12/site-packages/pharmpy/modeling/data.py\", line 2320, in bin_observations\n bincol, boundaries = pd.cut(\n ^^^^^^^\n", " File \"/domus/h1/yahs1790/.virtualenvs/pharmpy_12/lib/python3.12/site-packages/pandas/core/reshape/tile.py\", line 257, in cut\n fac, bins = _bins_to_cuts(\n ^^^^^^^^^^^^^^\n", " File \"/domus/h1/yahs1790/.virtualenvs/pharmpy_12/lib/python3.12/site-packages/pandas/core/reshape/tile.py\", line 443, in _bins_to_cuts\n raise ValueError(\n")Traceback (most recent call last): File "/domus/h1/yahs1790/.virtualenvs/pharmpy_12/lib/python3.12/site-packages/pharmpy/tools/amd/run.py", line 611, in run_amd final_vpc_plot = plot_vpc(final_model, simulation_data, stratify_on=dvid_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/domus/h1/yahs1790/.virtualenvs/pharmpy_12/lib/python3.12/site-packages/pharmpy/modeling/plots.py", line 1030, in plot_vpc chart = _vpc_plot(model, simulations, binning=binning, nbins=nbins, qi=qi, ci=ci) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/domus/h1/yahs1790/.virtualenvs/pharmpy_12/lib/python3.12/site-packages/pharmpy/modeling/plots.py", line 840, in _vpc_plot df = _calculate_vpc( ^^^^^^^^^^^^^^^ File "/domus/h1/yahs1790/.virtualenvs/pharmpy_12/lib/python3.12/site-packages/pharmpy/modeling/plots.py", line 729, in _calculate_vpc bincol, boundaries = bin_observations(model, binning, nbins) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/domus/h1/yahs1790/.virtualenvs/pharmpy_12/lib/python3.12/site-packages/pharmpy/modeling/data.py", line 2320, in bin_observations bincol, boundaries = pd.cut( ^^^^^^^ File "/domus/h1/yahs1790/.virtualenvs/pharmpy_12/lib/python3.12/site-packages/pandas/core/reshape/tile.py", line 257, in cut fac, bins = _bins_to_cuts( ^^^^^^^^^^^^^^ File "/domus/h1/yahs1790/.virtualenvs/pharmpy_12/lib/python3.12/site-packages/pandas/core/reshape/tile.py", line 443, in _bins_to_cuts raise ValueError( ValueError: Bin edges must be unique: Index([0.0, 0.0, 0.5, 1.0, 2.0, 3.0, 4.0, 6.0, 24.0], dtype='float64'). You can drop duplicate edges by setting the 'duplicates' kwarg