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

Enabling virtual_packet_logging causes error #1764

Closed
1 of 2 tasks
atharva-2001 opened this issue Jul 30, 2021 · 2 comments · Fixed by #1846
Closed
1 of 2 tasks

Enabling virtual_packet_logging causes error #1764

atharva-2001 opened this issue Jul 30, 2021 · 2 comments · Fixed by #1846

Comments

@atharva-2001
Copy link
Member

Describe the bug

An error is raised when one tries to enable virtual_packet_logging after run_tardis has been called once with virtual_packet_logging disabled.

To Reproduce

from tardis import run_tardis
sim = run_tardis('tardis_example.yml',log_level="info", show_cplots = False)
sim = run_tardis('tardis_example.yml', log_level="info",  virtual_packet_logging = True,show_cplots = False)

The error is raised in the last iteration of the second run:

[tardis.simulation.base][INFO   ]  Starting iteration 20 of 20 (base.py:359)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-1-c1d93772a6a1> in <module>
      1 from tardis import run_tardis
      2 sim = run_tardis('tardis_example.yml',log_level="info", show_cplots = False)
----> 3 sim = run_tardis('tardis_example.yml', log_level="info",  virtual_packet_logging = True,show_cplots = False)

~/workspace/gsoc/tardis-fork2/tardis/tardis/base.py in run_tardis(config, atom_data, packet_source, simulation_callbacks, virtual_packet_logging, show_cplots, log_level, specific, **kwargs)
    107         simulation.add_callback(*cb)
    108 
--> 109     simulation.run()
    110 
    111     return simulation

~/workspace/gsoc/tardis-fork2/tardis/tardis/simulation/base.py in run(self)
    429         )
    430         self.iterate(
--> 431             self.last_no_of_packets, self.no_of_virtual_packets, last_run=True
    432         )
    433 

~/workspace/gsoc/tardis-fork2/tardis/tardis/simulation/base.py in iterate(self, no_of_packets, no_of_virtual_packets, last_run)
    366             nthreads=self.nthreads,
    367             last_run=last_run,
--> 368             iteration=self.iterations_executed,
    369         )
    370         output_energy = self.runner.output_energy

~/workspace/gsoc/tardis-fork2/tardis/tardis/montecarlo/base.py in run(self, model, plasma, no_of_packets, no_of_virtual_packets, nthreads, last_run, iteration)
    302 
    303         configuration_initialize(self, no_of_virtual_packets)
--> 304         montecarlo_radial1d(model, plasma, self)
    305         self._integrator = FormalIntegrator(model, plasma, self)
    306         # montecarlo.montecarlo_radial1d(

~/workspace/gsoc/tardis-fork2/tardis/tardis/montecarlo/montecarlo_numba/base.py in montecarlo_radial1d(model, plasma, runner)
     87     if montecarlo_configuration.VPACKET_LOGGING and number_of_vpackets > 0:
     88         runner.virt_packet_nus = np.concatenate(
---> 89             np.array(virt_packet_nus)
     90         ).ravel()
     91         runner.virt_packet_energies = np.concatenate(

<__array_function__ internals> in concatenate(*args, **kwargs)

ValueError: need at least one array to concatenate

One can also raise the error by enabling virtual_packet_logging via the config file instead of the option in the run_tardis function, after the first run, without virtual_packet_logging enabled.

Screenshots

System

  • OS:

    • GNU/Linux
    • macOS
  • Environment (conda list):

# packages in environment at /home/atharva/.conda/envs/tardis:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       1_gnu    conda-forge
alabaster                 0.7.12                     py_0    conda-forge
alsa-lib                  1.2.3                h516909a_0    conda-forge
appdirs                   1.4.4              pyh9f0ad1d_0    conda-forge
argon2-cffi               20.1.0           py37h5e8e339_2    conda-forge
astropy                   3.2.3            py37h516909a_0    conda-forge
astropy-sphinx-theme      1.1                        py_0    conda-forge
async_generator           1.10                       py_0    conda-forge
atk-1.0                   2.36.0               h3371d22_4    conda-forge
attrs                     21.2.0             pyhd8ed1ab_0    conda-forge
babel                     2.9.1              pyh44b312d_0    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                        py_2    conda-forge
backports.functools_lru_cache 1.6.4              pyhd8ed1ab_0    conda-forge
black                     21.5b2             pyhd8ed1ab_0    conda-forge
bleach                    3.3.0              pyh44b312d_0    conda-forge
blosc                     1.21.0               h9c3ff4c_0    conda-forge
brotlipy                  0.7.0           py37h5e8e339_1001    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
c-ares                    1.17.1               h7f98852_1    conda-forge
ca-certificates           2021.5.30            ha878542_0    conda-forge
cached-property           1.5.2                hd8ed1ab_1    conda-forge
cached_property           1.5.2              pyha770c72_1    conda-forge
cairo                     1.16.0            h6cf1ce9_1008    conda-forge
certifi                   2021.5.30        py37h89c1867_0    conda-forge
cffi                      1.14.5           py37hc58025e_0    conda-forge
chardet                   4.0.0            py37h89c1867_1    conda-forge
click                     8.0.1            py37h89c1867_0    conda-forge
colorama                  0.4.4              pyh9f0ad1d_0    conda-forge
commonmark                0.9.1                      py_0    conda-forge
coverage                  5.5              py37h5e8e339_0    conda-forge
cryptography              3.4.7            py37h5d9358c_0    conda-forge
cycler                    0.10.0                     py_2    conda-forge
dataclasses               0.8                pyhc8e2a94_1    conda-forge
dbus                      1.13.6               h48d8840_2    conda-forge
decorator                 4.4.2                      py_0    conda-forge
defusedxml                0.7.1              pyhd8ed1ab_0    conda-forge
docutils                  0.16             py37h89c1867_3    conda-forge
dokuwiki                  1.2.1                    pypi_0    pypi
dot2tex                   2.11.3                   pypi_0    pypi
entrypoints               0.3             pyhd8ed1ab_1003    conda-forge
expat                     2.4.1                h9c3ff4c_0    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 hab24e00_0    conda-forge
fontconfig                2.13.1            hba837de_1005    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
freetype                  2.10.4               h0708190_1    conda-forge
fribidi                   1.0.10               h36c2ea0_0    conda-forge
future                    0.18.2           py37h89c1867_3    conda-forge
gdk-pixbuf                2.42.6               h04a7f16_0    conda-forge
gettext                   0.19.8.1          h0b5b191_1005    conda-forge
giflib                    5.2.1                h36c2ea0_2    conda-forge
git-lfs                   2.13.3               ha770c72_0    conda-forge
glib                      2.68.3               h9c3ff4c_0    conda-forge
glib-tools                2.68.3               h9c3ff4c_0    conda-forge
graphite2                 1.3.13            h58526e2_1001    conda-forge
graphviz                  2.47.2               h85b4f2f_0    conda-forge
gst-plugins-base          1.18.4               hf529b03_2    conda-forge
gstreamer                 1.18.4               h76c114f_2    conda-forge
gtk2                      2.24.33              h539f30e_1    conda-forge
gts                       0.7.6                h64030ff_2    conda-forge
h5py                      3.2.1           nompi_py37ha3df211_100    conda-forge
harfbuzz                  2.8.1                h83ec7ef_0    conda-forge
hdf5                      1.10.6          nompi_h6a2412b_1114    conda-forge
hypothesis                6.14.0             pyhd8ed1ab_0    conda-forge
icu                       68.1                 h58526e2_0    conda-forge
idna                      2.10               pyh9f0ad1d_0    conda-forge
imagesize                 1.2.0                      py_0    conda-forge
importlib-metadata        4.5.0            py37h89c1867_0    conda-forge
importlib_metadata        4.5.0                hd8ed1ab_0    conda-forge
iniconfig                 1.1.1              pyh9f0ad1d_0    conda-forge
ipykernel                 5.5.5            py37h085eea5_0    conda-forge
ipython                   7.24.1           py37h085eea5_0    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
ipywidgets                7.6.3              pyhd3deb0d_0    conda-forge
jbig                      2.1               h7f98852_2003    conda-forge
jedi                      0.18.0           py37h89c1867_2    conda-forge
jinja2                    3.0.1              pyhd8ed1ab_0    conda-forge
jpeg                      9d                   h36c2ea0_0    conda-forge
jsonpointer               2.0                        py_0    conda-forge
jsonschema                3.2.0              pyhd8ed1ab_3    conda-forge
jupyter                   1.0.0            py37h89c1867_6    conda-forge
jupyter_client            6.1.12             pyhd8ed1ab_0    conda-forge
jupyter_console           6.4.0              pyhd8ed1ab_0    conda-forge
jupyter_core              4.7.1            py37h89c1867_0    conda-forge
jupyterlab_pygments       0.1.2              pyh9f0ad1d_0    conda-forge
jupyterlab_widgets        1.0.0              pyhd8ed1ab_1    conda-forge
kaleido-core              0.2.1                h3644ca4_0    conda-forge
kiwisolver                1.3.1            py37h2527ec5_1    conda-forge
krb5                      1.19.1               hcc1bbae_0    conda-forge
latexcodec                2.0.1              pyh9f0ad1d_0    conda-forge
lcms2                     2.12                 hddcbb42_0    conda-forge
ld_impl_linux-64          2.35.1               hea4e1c9_2    conda-forge
lerc                      2.2.1                h9c3ff4c_0    conda-forge
libblas                   3.9.0                9_openblas    conda-forge
libcblas                  3.9.0                9_openblas    conda-forge
libclang                  11.1.0          default_ha53f305_1    conda-forge
libcurl                   7.77.0               h2574ce0_0    conda-forge
libdeflate                1.7                  h7f98852_5    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 h516909a_1    conda-forge
libevent                  2.1.10               hcdb4288_3    conda-forge
libffi                    3.3                  h58526e2_2    conda-forge
libgcc-ng                 9.3.0               h2828fa1_19    conda-forge
libgd                     2.3.2                h78a0170_0    conda-forge
libgfortran-ng            9.3.0               hff62375_19    conda-forge
libgfortran5              9.3.0               hff62375_19    conda-forge
libglib                   2.68.3               h3e27bee_0    conda-forge
libgomp                   9.3.0               h2828fa1_19    conda-forge
libiconv                  1.16                 h516909a_0    conda-forge
liblapack                 3.9.0                9_openblas    conda-forge
libllvm10                 10.0.1               he513fc3_3    conda-forge
libllvm11                 11.1.0               hf817b99_2    conda-forge
libnghttp2                1.43.0               h812cca2_0    conda-forge
libogg                    1.3.4                h7f98852_1    conda-forge
libopenblas               0.3.15          pthreads_h8fe5266_1    conda-forge
libopus                   1.3.1                h7f98852_1    conda-forge
libpng                    1.6.37               h21135ba_2    conda-forge
libpq                     13.3                 hd57d9b9_0    conda-forge
librsvg                   2.50.7               hc3c00ef_0    conda-forge
libsodium                 1.0.18               h36c2ea0_1    conda-forge
libssh2                   1.9.0                ha56f1ee_6    conda-forge
libstdcxx-ng              9.3.0               h6de172a_19    conda-forge
libtiff                   4.3.0                hf544144_1    conda-forge
libtool                   2.4.6             h58526e2_1007    conda-forge
libuuid                   2.32.1            h7f98852_1000    conda-forge
libvorbis                 1.3.7                h9c3ff4c_0    conda-forge
libwebp                   1.2.0                h3452ae3_0    conda-forge
libwebp-base              1.2.0                h7f98852_2    conda-forge
libxcb                    1.13              h7f98852_1003    conda-forge
libxkbcommon              1.0.3                he3ba5ed_0    conda-forge
libxml2                   2.9.12               h72842e0_0    conda-forge
libxslt                   1.1.33               h15afd5d_2    conda-forge
llvmlite                  0.36.0           py37h9d7f4d0_0    conda-forge
lz4-c                     1.9.3                h9c3ff4c_0    conda-forge
lzo                       2.10              h516909a_1000    conda-forge
markupsafe                2.0.1            py37h5e8e339_0    conda-forge
mathjax                   2.7.7                         0    conda-forge
matplotlib                3.4.2            py37h89c1867_0    conda-forge
matplotlib-base           3.4.2            py37hdd32ed1_0    conda-forge
matplotlib-inline         0.1.2              pyhd8ed1ab_2    conda-forge
mistune                   0.8.4           py37h5e8e339_1003    conda-forge
mock                      4.0.3            py37h89c1867_1    conda-forge
more-itertools            8.8.0              pyhd8ed1ab_0    conda-forge
mypy                      0.901              pyhd3eb1b0_0  
mypy_extensions           0.4.3            py37h89c1867_3    conda-forge
mysql-common              8.0.25               ha770c72_2    conda-forge
mysql-libs                8.0.25               hfa10184_2    conda-forge
nbclient                  0.5.3              pyhd8ed1ab_0    conda-forge
nbconvert                 6.0.7            py37h89c1867_3    conda-forge
nbformat                  5.1.3              pyhd8ed1ab_0    conda-forge
nbsphinx                  0.8.6              pyhd8ed1ab_1    conda-forge
ncurses                   6.2                  h58526e2_4    conda-forge
nest-asyncio              1.5.1              pyhd8ed1ab_0    conda-forge
networkx                  2.5.1              pyhd8ed1ab_0    conda-forge
notebook                  6.4.0              pyha770c72_0    conda-forge
nspr                      4.30                 h9c3ff4c_0    conda-forge
nss                       3.67                 hb5efdd6_0    conda-forge
numba                     0.53.1           py37hb11d6e1_1    conda-forge
numexpr                   2.7.3            py37hdc94413_0    conda-forge
numpy                     1.19.5           py37haa41c4c_1    conda-forge
numpydoc                  1.1.0                      py_1    conda-forge
olefile                   0.46               pyh9f0ad1d_1    conda-forge
openjpeg                  2.4.0                hb52868f_1    conda-forge
openssl                   1.1.1k               h7f98852_0    conda-forge
packaging                 20.9               pyh44b312d_0    conda-forge
pandas                    1.0.5            py37h0da4684_0    conda-forge
pandoc                    2.14.0.1             h7f98852_0    conda-forge
pandocfilters             1.4.2                      py_1    conda-forge
pango                     1.48.5               hb8ff022_0    conda-forge
parso                     0.8.2              pyhd8ed1ab_0    conda-forge
pathspec                  0.8.1              pyhd3deb0d_0    conda-forge
pbr                       5.6.0              pyhd8ed1ab_0    conda-forge
pcre                      8.44                 he1b5a44_0    conda-forge
pexpect                   4.8.0              pyh9f0ad1d_2    conda-forge
pickle5                   0.0.11           py37h5e8e339_0    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pillow                    8.2.0            py37h4600e1f_1    conda-forge
pip                       21.1.2             pyhd8ed1ab_0    conda-forge
pixman                    0.40.0               h36c2ea0_0    conda-forge
plotly                    4.14.3             pyh44b312d_0    conda-forge
pluggy                    0.13.1           py37h89c1867_4    conda-forge
prometheus_client         0.11.0             pyhd8ed1ab_0    conda-forge
prompt-toolkit            3.0.18             pyha770c72_0    conda-forge
prompt_toolkit            3.0.18               hd8ed1ab_0    conda-forge
psutil                    5.8.0            py37h5e8e339_1    conda-forge
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
py                        1.10.0             pyhd3deb0d_0    conda-forge
pybtex                    0.24.0           py37h89c1867_0    conda-forge
pybtex-docutils           1.0.0            py37h89c1867_0    conda-forge
pycparser                 2.20               pyh9f0ad1d_2    conda-forge
pydocstyle                6.1.1              pyhd3eb1b0_0  
pygments                  2.9.0              pyhd8ed1ab_0    conda-forge
pygraphviz                1.7              py37h0b1d2a2_0    conda-forge
pyne                      0.7.3           nomoab_noopenmcpy37h879b29b_1    conda-forge
pyopenssl                 20.0.1             pyhd8ed1ab_0    conda-forge
pyparsing                 2.4.7              pyh9f0ad1d_0    conda-forge
pyqt                      5.12.3           py37h89c1867_7    conda-forge
pyqt-impl                 5.12.3           py37he336c9b_7    conda-forge
pyqt5-sip                 4.19.18          py37hcd2ae1e_7    conda-forge
pyqtchart                 5.12             py37he336c9b_7    conda-forge
pyqtwebengine             5.12.1           py37he336c9b_7    conda-forge
pyrsistent                0.17.3           py37h5e8e339_2    conda-forge
pyside2                   5.13.2           py37hfa98aef_4    conda-forge
pysocks                   1.7.1            py37h89c1867_3    conda-forge
pytables                  3.6.1            py37h0c4f3e0_3    conda-forge
pytest                    6.2.4            py37h89c1867_0    conda-forge
pytest-arraydiff          0.3                        py_0    conda-forge
pytest-astropy            0.8.0              pyhd8ed1ab_0    conda-forge
pytest-astropy-header     0.1.2                      py_0    conda-forge
pytest-cov                2.12.1             pyhd8ed1ab_0    conda-forge
pytest-doctestplus        0.9.0              pyhd8ed1ab_0    conda-forge
pytest-filter-subpackage  0.1.1                      py_0    conda-forge
pytest-html               3.1.1              pyhd8ed1ab_0    conda-forge
pytest-metadata           1.11.0             pyhd3deb0d_0    conda-forge
pytest-mock               3.6.1              pyhd8ed1ab_0    conda-forge
pytest-openfiles          0.5.0                      py_0    conda-forge
pytest-remotedata         0.3.2              pyh9f0ad1d_0    conda-forge
python                    3.7.10          hffdb5ce_100_cpython    conda-forge
python-dateutil           2.8.1                      py_0    conda-forge
python-kaleido            0.2.1              pyhd8ed1ab_0    conda-forge
python_abi                3.7                     1_cp37m    conda-forge
pytz                      2021.1             pyhd8ed1ab_0    conda-forge
pyyaml                    5.4.1            py37h5e8e339_0    conda-forge
pyzmq                     22.1.0           py37h336d617_0    conda-forge
qgrid                     1.3.1              pyhd8ed1ab_3    conda-forge
qt                        5.12.9               hda022c4_4    conda-forge
qtconsole                 5.1.0              pyhd8ed1ab_0    conda-forge
qtpy                      1.9.0                      py_0    conda-forge
readline                  8.1                  h46c0cb4_0    conda-forge
recommonmark              0.7.1              pyhd8ed1ab_0    conda-forge
regex                     2021.4.4         py37h5e8e339_0    conda-forge
requests                  2.25.1             pyhd3deb0d_0    conda-forge
retrying                  1.3.3                      py_2    conda-forge
scipy                     1.5.3            py37h14a347d_0    conda-forge
send2trash                1.5.0                      py_0    conda-forge
setuptools                49.6.0           py37h89c1867_3    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
snowballstemmer           2.1.0              pyhd8ed1ab_0    conda-forge
sortedcontainers          2.4.0              pyhd8ed1ab_0    conda-forge
sphinx                    4.0.2              pyh6c4a22f_1    conda-forge
sphinx-astropy            1.3                pyh9f0ad1d_0    conda-forge
sphinx-automodapi         0.13                       py_0    conda-forge
sphinx-gallery            0.9.0              pyhd8ed1ab_0    conda-forge
sphinx-jsonschema         1.16.8             pyhd8ed1ab_0    conda-forge
sphinx_bootstrap_theme    0.8.0                      py_0    conda-forge
sphinx_rtd_theme          0.5.2              pyhd8ed1ab_1    conda-forge
sphinxcontrib-apidoc      0.3.0                      py_1    conda-forge
sphinxcontrib-applehelp   1.0.2                      py_0    conda-forge
sphinxcontrib-bibtex      2.3.0              pyhd8ed1ab_0    conda-forge
sphinxcontrib-devhelp     1.0.2                      py_0    conda-forge
sphinxcontrib-htmlhelp    2.0.0              pyhd8ed1ab_0    conda-forge
sphinxcontrib-jsmath      1.0.1                      py_0    conda-forge
sphinxcontrib-qthelp      1.0.3                      py_0    conda-forge
sphinxcontrib-serializinghtml 1.1.5              pyhd8ed1ab_0    conda-forge
sphinxcontrib-tikz        0.4.13                   pypi_0    pypi
sqlite                    3.35.5               h74cdb3f_0    conda-forge
tardis-sn                 3.0.dev3992               dev_0    <develop>
terminado                 0.10.1           py37h89c1867_0    conda-forge
testpath                  0.5.0              pyhd8ed1ab_0    conda-forge
tk                        8.6.10               h21135ba_1    conda-forge
toml                      0.10.2             pyhd8ed1ab_0    conda-forge
tornado                   6.1              py37h5e8e339_1    conda-forge
tqdm                      4.61.1             pyhd8ed1ab_0    conda-forge
traitlets                 5.0.5                      py_0    conda-forge
typed-ast                 1.4.3            py37h5e8e339_0    conda-forge
typing_extensions         3.10.0.0           pyha770c72_0    conda-forge
urllib3                   1.26.5             pyhd8ed1ab_0    conda-forge
wcwidth                   0.2.5              pyh9f0ad1d_2    conda-forge
webencodings              0.5.1                      py_1    conda-forge
wheel                     0.36.2             pyhd3deb0d_0    conda-forge
widgetsnbextension        3.5.1            py37h89c1867_4    conda-forge
xorg-kbproto              1.0.7             h7f98852_1002    conda-forge
xorg-libice               1.0.10               h7f98852_0    conda-forge
xorg-libsm                1.2.3             hd9c2040_1000    conda-forge
xorg-libx11               1.7.2                h7f98852_0    conda-forge
xorg-libxau               1.0.9                h7f98852_0    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xorg-libxext              1.3.4                h7f98852_1    conda-forge
xorg-libxrender           0.9.10            h7f98852_1003    conda-forge
xorg-renderproto          0.11.1            h7f98852_1002    conda-forge
xorg-xextproto            7.3.0             h7f98852_1002    conda-forge
xorg-xproto               7.0.31            h7f98852_1007    conda-forge
xz                        5.2.5                h516909a_1    conda-forge
yaml                      0.2.5                h516909a_0    conda-forge
zeromq                    4.3.4                h9c3ff4c_0    conda-forge
zipp                      3.4.1              pyhd8ed1ab_0    conda-forge
zlib                      1.2.11            h516909a_1010    conda-forge
zstd                      1.5.0                ha95c52a_0    conda-forge
​

Additional context

@yuyizheng1112
Copy link
Contributor

Same error

@AstronoMoore
Copy link

Same error

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

Successfully merging a pull request may close this issue.

4 participants