primordic/IssueDupesLite huggingface dataset:
Repository: pymc-devs/pymc

Issue #5993: Implied dimensions of RVs are not broadcasted by dims or observed
Created: 2022-07-21T03:11:54Z
The dims argument is not respected when a random variable is created with parameters that broadcast to the desired output dimensions:
coords = {
     "dim1": pd.RangeIndex(10),
     "dim2": pd.RangeIndex(7)
}

with pm.Model(coords=coords) as model:
     mu = np.zeros((10, 1))
     x = pm.Normal("x", mu=mu, dims=("dim1", "dim2"))
     y = pm.Normal("y", mu=mu, dims=("dim1", "dim2"), shape=(10, 7))

x.eval().shape
# Returns (10, 1), when it should be (10, 7)

y.eval().shape
# Correctly returns (10, 7)

PyMC/PyMC3 Version: latest release 4.1.3
Aesara/Theano Version:
Python Version:
Operating system:
How did you install PyMC/PyMC3: conda

Duplicate issue #5992: Data objects not connected to binomial, Poisson likelihood when parameters have non-scalar shape
Created: 2022-07-20T20:10:52Z
Description of your problem
When using Data or MutableData objects with binomial or Poisson likelihoods, they are not properly added to the model graph when the likelihood has non-scalar shapes. For example, this works fine:
Please provide a minimal, self-contained, and reproducible example.
import pymc as pm 
import numpy as np
with pm.Model() as m:
    # Initialize with dummy values
    X = pm.MutableData("X", np.empty(3))

    mu = pm.Exponential('mu', 5)
    theta_like = pm.Poisson(
        "theta_like",
        mu=mu,
        observed=X,
    )

Yet giving mu a non-scalar shape breaks the model graph:
import pymc as pm 
import numpy as np
with pm.Model() as m:
    # Initialize with dummy values
    X = pm.MutableData("X", np.empty(3))

    mu = pm.Exponential('mu', 5, shape=3)
    theta_like = pm.Poisson(
        "theta_like",
        mu=mu,
        observed=X,
    )

Interestingly, this does not occur for some other likelihoods (e.g. normal).
I discovered this when the Binomial model appeared not to be learning when sampling with data.

Versions and main components

PyMC/PyMC3 Version: 4.1.2
Aesara Version:  2.7.5
Python Version: 3.8.9
Operating system: Ubuntu
How did you install PyMC/PyMC3: pip

Closing comment (2022-08-10T12:12:54Z): By the way, this is also indicative of a bug in the variable creation logic, as observed may have broadcasted shapes beyond the parameters (e.g. if mu.shape=(1,)), and PyMC would not have taken this into consideration.
This is related to #5993, although that one shows the bug in relation to dims, and this one is in relation to observed.
Repository: pymc-devs/pymc

Issue #4553: Do not force lower precision in intX
Created: 2021-03-19T07:24:51Z
Description of your problem
Please provide a minimal, self-contained, and reproducible example.
See implementation here
https://github.com/pymc-devs/pymc3/blob/c1efb7ad51e34e6bd8b292ef226a7e191adbdb82/pymc3/theanof.py#L92
for float32 precision, it converts values to int16
for float64 precision, it converts values to int32
But the implementation of Binomial distributions
https://github.com/pymc-devs/pymc3/blob/c1efb7ad51e34e6bd8b292ef226a7e191adbdb82/pymc3/distributions/multivariate.py#L714
https://github.com/pymc-devs/pymc3/blob/c1efb7ad51e34e6bd8b292ef226a7e191adbdb82/pymc3/distributions/discrete.py#L103
Does not assume a float is converted to int, thus converting ints in this way may overflow (I ran exactly into this issue)
Please provide the full traceback.
The referenced code is enough to spot the problem
Please provide any additional information below.
The issue is also relevant to pymc v4
Versions and main components

PyMC3 Version: 3.11.2
Aesara Version: None
Python Version: 3.8.9
Operating system: Archlinux
How did you install PyMC3: pip

Duplicate issue #3475: Int32 or Int64 for discrete?
Created: 2019-05-10T05:11:20Z
Through a recent discourse thread I found that Discrete allows int16 or int64 dtypes. Given what we had done for parameters regarding #2366 (we set int16 if floatX is float32 and int32 if floatX is float64), should we change Discrete to work with int16 and int32? What do we do with int64's?

Closing comment (2021-06-27T06:27:57Z): Related to #4553
Repository: pymc-devs/pymc

Issue #4188: Hotlinked image has been changed and now shows advertisement text
Created: 2020-10-26T14:25:05Z
Description
In the "GLM hierarchical model" example notebook, there's supposed to be an image that shows how Radon gas enters a house. This image is hotlinked (rather than embedded or such), and the site hosting the original image has apparently cottoned on to this. They've replaced the image with message saying "visit fix-your-radon" instead.
See for examples:

https://docs.pymc.io/notebooks/GLM-hierarchical.html
https://github.com/pymc-devs/pymc3/blob/master/docs/source/notebooks/GLM-hierarchical.ipynb

I'm happy to make a PR to change this image, but I wanted to discuss options first. Either:

Hotlink to a new image - but accept the risk of this situation arising again
Use a more reputable image (e.g. this one from Wikimedia)
Store the (binary) image on Git as a binary
etc...

Versions and main components

PyMC3 Version: 3.9.3
Theano Version: n/a
Python Version: n/a
Operating system: n/a
How did you install PyMC3: n/a

Duplicate issue #4189: Broken hotlinked image in example notebooks
Created: 2020-10-26T14:25:27Z
Description
In the "GLM hierarchical model" example notebook, there's supposed to be an image that shows how Radon gas enters a house. This image is hotlinked (rather than embedded or such), and the site hosting the original image has apparently cottoned on to this. They've replaced the image with message saying "visit fix-your-radon" instead.
See for examples:

https://docs.pymc.io/notebooks/GLM-hierarchical.html
https://github.com/pymc-devs/pymc3/blob/master/docs/source/notebooks/GLM-hierarchical.ipynb

I'm happy to make a PR to change this image, but I wanted to discuss options first. Either:

Hotlink to a new image - but accept the risk of this situation arising again
Use a more reputable image source (e.g. this one from Wikimedia)
Store the (binary) image on Git as a binary
etc...

Versions and main components

PyMC3 Version: 3.9.3
Theano Version: n/a
Python Version: n/a
Operating system: n/a
How did you install PyMC3: n/a

Closing comment (2020-10-26T14:29:10Z): My browser bugged out and I ended up submitting this issue twice. Closing as duplicate of #4188. 🤦
Repository: pymc-devs/pymc

Issue #4642: Port timeseries distributions to V4
Created: 2021-04-14T14:27:14Z
import pymc3 as pm
import numpy as np

returns = pd.read_csv(pm.get_data("SP500.csv"), index_col="Date")
returns["change"] = np.log(returns["Close"]).diff()
returns = returns.dropna().astype('float32')
returns.head()

with pm.Model() as model_pymc3:
    step_size = pm.Exponential("step_size", 10.)
    volatility = pm.GaussianRandomWalk("volatility", sigma=step_size, 
                                       size=returns.shape[0], 
                                       init=pm.Normal.dist(0, step_size))
    nu = pm.Exponential("nu", 0.1)
    obs = pm.StudentT(
        "obs", nu=nu, sigma=np.exp(volatility), observed=returns["change"]
    )
yields:
TypeError                                 Traceback (most recent call last)
<ipython-input-11-3f1576c8cf84> in <module>
      1 with pm.Model(check_bounds=False) as model_pymc3:
      2     step_size = pm.Exponential("step_size", 10.)
----> 3     volatility = pm.GaussianRandomWalk("volatility", sigma=step_size, 
      4                                        size=returns.shape[0],
      5                                        init=pm.Normal.dist(0, step_size))

~/projects/pymc/pymc3/distributions/distribution.py in __new__(cls, name, *args, **kwargs)
    161         transform = kwargs.pop("transform", UNSET)
    162 
--> 163         rv_out = cls.dist(*args, rng=rng, **kwargs)
    164 
    165         return model.register_rv(rv_out, name, data, total_size, dims=dims, transform=transform)

TypeError: dist() missing 1 required positional argument: 'dist_params'

Duplicate issue #5291: Add autoregressive model to V4
Created: 2021-12-28T20:34:03Z
created this issue linked to the project for porting time series distributions to v4

Closing comment (2021-12-28T20:40:45Z): related to #4642
Repository: pypa/virtualenv

Issue #457: Problem with non ASCII car in path
Created: 2013-07-29T21:39:35Z
I don't know if this is related to #186 but with my fresh install of python on my Windows 8 I've the following error when using virtualenv in the path C:\Users\oncleben\Dropbox\Developement\fraisDeSanté
C:\Users\oncleben\Dropbox\Developement\fraisDeSanté> virtualenv ENV
New python executable in ENV\Scripts\python.exe
Traceback (most recent call last):
  File "<string>", line 1, in <module>
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 50: ordinal not in range(128)
ERROR: The executable ENV\Scripts\python.exe is not functioning
ERROR: It thinks sys.prefix is u'c:\\users\\oncleben\\dropbox\\developement\\fraisdesant\xe9' (should be u'c:\\users\\on
cleben\\dropbox\\developement\\fraisdesant\xe9\\env')
ERROR: virtualenv is not compatible with this system or executable
Note: some Windows users have reported this error when they installed Python for "Only this user" or have multiple versi
ons of Python installed. Copying the appropriate PythonXX.dll to the virtualenv Scripts/ directory may fix this problem.


python v2.7.5
pip list
nose (1.3.0)
pip (1.4)
Scaffold (0.1.3)
setuptools (0.9.7)
virtualenv (1.10)
Edit:

emoji - see #1014 - 🚒
è - see #1392
Cyrillic - see #1375
$ character

Duplicate issue #1014: Not compatible with a directory having emojis in its path
Created: 2017-02-07T12:51:04Z
Am getting this Traceback when running virtualenv venv to create a virtualenv in a directory having emojis etc in its path -
New python executable in /Users/WARL0CK/✮✮Python✮✮/evalai/venv/bin/python2.7 Also creating executable in /Users/WARL0CK/✮✮Python✮✮/evalai/venv/bin/python Traceback (most recent call last): File "<string>", line 1, in <module> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 15: ordinal not in range(128) ERROR: The executable /Users/WARL0CK/✮✮Python✮✮/evalai/venv/bin/python2.7 is not functioning ERROR: It thinks sys.prefix is u'/Users/WARL0CK/\u272e\u272ePython\u272e\u272e/evalai' (should be u'/Users/WARL0CK/\u272e\u272ePython\u272e\u272e/evalai/venv') ERROR: virtualenv is not compatible with this system or executable

Closing comment (2019-12-28T09:43:19Z): Duplicate of #457
Repository: pypa/virtualenv

Issue #369: Virtualenv always using sytem site packages with macos 10.6 system python
Created: 2012-11-28T13:40:21Z
Creating a fresh virtualenv with either --system-site-packages or --no-site-packages results in the system site-packages being available in the venv. Furthermore, installing new packages don't override the system pacakges unless -e is used. Example:
ofaletses-MacBook-Pro:~ ofaletse$ virtualenv --no-site-packages test_venv/ New python executable in test_venv/bin/python Installing setuptools............done. Installing pip...............done. ofaletses-MacBook-Pro:~ ofaletse$ source test_venv/bin/activate (test_venv)ofaletses-MacBook-Pro:~ ofaletse$ python -c 'import blinker ; print blinker.__version__' 1.2 (test_venv)ofaletses-MacBook-Pro:~ ofaletse$ # System installed version, should not be visible (test_venv)ofaletses-MacBook-Pro:~ ofaletse$ pip install blinker==1.0 Downloading/unpacking blinker==1.0 Downloading blinker-1.0.tar.gz (61kB): 61kB downloaded Running setup.py egg_info for package blinker Installing collected packages: blinker Found existing installation: blinker 1.2 Not uninstalling blinker at /Library/Python/2.6/site-packages, outside environment /Users/ofaletse/test_venv/bin/.. Running setup.py install for blinker Successfully installed blinker Cleaning up... (test_venv)ofaletses-MacBook-Pro:~ ofaletse$ python -c 'import blinker ; print blinker.__version__' 1.2 (test_venv)ofaletses-MacBook-Pro:~ ofaletse$ # Still using system package (test_venv)ofaletses-MacBook-Pro:~ ofaletse$ ls test_venv/lib/python2.6/site-packages/ blinker             easy-install.pth        setuptools-0.6c11-py2.6.egg blinker-1.0-py2.6.egg-info  pip-1.2.1-py2.6.egg     setuptools.pth (test_venv)ofaletses-MacBook-Pro:~ ofaletse$ # although blinker does seem to be installed in the virtualenv (test_venv)ofaletses-MacBook-Pro:~ ofaletse$
Full version of MacOS: 10.6.8 (Snow Leopard), using system installed python2.6

Duplicate issue #245: --no-site-packages doesn't work on OS X
Created: 2012-03-28T16:35:55Z
OS X has the user packages located in a different path from Linux: not .local but ~/Library. That's probably confusing virtualenv, since the user installed site-packages are still included.

Closing comment (2013-02-26T01:02:48Z): looks like duplicate of #369 @tpievila Could you check my last comment there and post the output the commands produce on your system?
Repository: pypa/virtualenv

Issue #521: virtualenv 1.11 doesn't install pip if system-site-packages is used
Created: 2014-01-02T17:54:55Z
Potential regression due to switch from sdist to wheel.
When you create a virtualenv with --system-site-packages, virtualenv does not install pip into the virtualenv if it finds one at the system level. This has later repurcussions on installing software into the venv.

Duplicate issue #536: virtualenv does not install pip with system-site-packages flag
Created: 2014-01-09T13:56:10Z
Virtualenv 1.11 with Python 2.7.6 on OsX Mavericks does not install pip into the newly created virtualenv when using the --system-site-packages flag.
Therefore pip install xxx installs xxx into the system-site-packages.
When using virtualenv 1.10.1 everything seems to be fine.

Closing comment (2014-01-09T16:37:51Z): dupe of #521
this has a fix and is due to be released in v1.11.1
Repository: pypa/virtualenv

Issue #1380: hundreds of processes spawned
Created: 2019-07-09T14:32:17Z
After installing python 3.7.4 64 bit, i attempted to start a virtual environment in a folder. However, about a thousand python processes were started and the virtual environment did not get completed.
OS: Windows 10 Home
Code run in Cygwin 64 bit
Failing code:
mkdir test
cd test
virtualenv venv

pip list

Package           Version

astroid           2.2.0
colorama          0.4.1
isort             4.3.9
lazy-object-proxy 1.3.1
mccabe            0.6.1
pip               19.1.1
pylint            2.3.0
rope              0.14.0
setuptools        40.8.0
six               1.12.0
typed-ast         1.3.1
virtualenv        16.6.1
wrapt             1.11.1

Duplicate issue #1381: Creating virtual env failed with python 3.7.4
Created: 2019-07-11T02:26:41Z
[Python ] Python 3.7.4
Windows 10
Virtualenv 16.6.1

Try to create a virtual environment using

virtualenv env
Then got unending messages

Closing comment (2019-07-11T07:46:01Z): Duplicate of #1380
Repository: pypa/virtualenv

Issue #616: Whitespace in Python install folder causes error
Created: 2014-06-08T03:57:17Z
This is during a VirtualEnv creation. An exception arises after "Cleaning up...". The last line is:
File "C:\Program Files\Python\Python2\lib\site-packages\virtualenv_support\pip
-1.5.4-py2.py3-none-any.whl\pip_vendor\requests\sessions.py", line 526, in get_
adapter
raise InvalidSchema("No connection adapters were found for '%s'" % url)
InvalidSchema: No connection adapters were found for 'c:\Program'

Duplicate issue #637: virtualenv 1.11.6, Windows and spaces in paths
Created: 2014-08-06T08:18:39Z
Please fix this issue pypa/pip#1961, release a new pip and then a new virtualenv.
Currently it is not possible to create a virtualenv (with v1.11.6) under Windows if one path (path to python.exe or path to virtualenv) contains a space.

Closing comment (2015-01-24T20:01:05Z): I think it is the same as #616. I use Python 2.7.9 64 bit, distlib 0.2.0, pip 6.0.6, virtualenv 12.0.5 and my Python path is c:\Program Files\Python 2.7
Repository: pyscf/pyscf

Issue #1067: nuclear-gradients of integrals in AO basis
Created: 2021-09-30T23:46:31Z
Hi,
I noticed perhaps a similar issue (#620) however, I did not find a solution.
I have used PSI4 before, but new to PySCF,
I am wondering how one would compute the nuclear gradient of AO integrals (both 1e and 2e). In PSI4, I my compute, say derivative of overlap, dS_ixAB
("A,B" being AO basis indices,
"i" being the atomic index, &
"x" being the Cartesian index rep. {x,y,z}).
In PySCF using: <mol.intor('int1e_ipovlp', comp=3)>, I get something of shape dS_xAB (3, N, N), hence I'm missing the atomic index.
So my question is how do I obtain dS_ixAB in PySCF?
Thanks for your help,
Julio

Duplicate issue #992: Computing analytic first and second derivatives of electron integrals, with respect to nuclear coordinates?
Created: 2021-06-22T13:25:51Z
Is it possible to compute analytic first and second order derivatives with respect to nuclear coordinates of the one and two-electron integrals:

using PySCF functionality?

Closing comment (2021-10-06T00:28:53Z): Duplicate of #1067
Repository: pyscf/pyscf

Issue #735: Diagonal Born-Oppenheimer Correction
Created: 2020-10-14T06:48:54Z
Could calculation of energy corrections due to the diagonal born-Oppenheimer correction be added? I'm particularly interested in geometry optimizations, so DBOC-corrected energies would be essential, assuming that the geometry optimizers currently used can work with just energies and don't need gradients and Hessians as well.

Duplicate issue #2417: Diagonal Born-Oppenheimer Correction
Created: 2024-09-15T13:50:40Z
Hey there! I was wondering if anyone could help me with a little problem I'm having. I'm trying to calculate the diagonal Born-Oppenheimer correction for the H2 molecule with pyscf using the built-in functions. Would anyone be so kind as to show me how to do this at the CCSD or CISD level? Thanks in advance! 😊

Closing comment (2024-09-16T19:50:00Z): There is also an implementation for NACs in this repository for regular SA-CASSCF. Example examples/nac/01-sacasscf_nac.py.
Also, this issue is related to #735; though I think with different outcomes desired.
Repository: pyscf/pyscf

Issue #825: R2SCAN-3c
Created: 2021-02-25T00:10:19Z
Feature request for R2SCAN-3c. The Summary and Conclusions of the paper makes the case pretty well.
https://doi.org/10.1063/5.0040021
Requires D4, gCP and a tailored basis set.
R2SCAN is used unaltered, and I see there is a pull request for libxc 5.1.0 which contains that DFA.

Duplicate issue #2569: Implementing composite methods like r2SCAN-3c
Created: 2024-12-18T16:10:41Z
Hi all,
I was wondering what is the recommended way to use modern composite methods like r2SCAN-3c, PBEh-3c, or the B97's with PySCF.
I could be wrong, but my understanding is that while one can add dftd4 corrections to the energy afterwards, this won't make it into other computations (e.g. geometry optimization/energy minimization). Additionally, short range corrections still have to be implemented separately.
Cheers.

Closing comment (2024-12-22T23:03:59Z): Related to #825
Repository: pyscf/pyscf

Issue #2289: Smearing electron number bug
Created: 2024-06-24T22:51:01Z
Smeared RHF with odd nelec gives incorrect electron number.
from pyscf import gto, scf
from pyscf.scf import addons

mol = gto.Mole()
mol.atom = '''
    7      0.   0  -0.7
    7      0.   0   0.7'''
mol.basis = 'cc-pvdz'
mol.charge = -1
mol.spin = 1
mol.build()
mf = scf.RHF(mol)
mf = addons.smearing(mf, sigma=0.1)
mf.kernel()
print(mf.mol.nelectron)
print(mf.mo_occ.sum())

converged SCF energy = -42.2391465363651
15
16.0

Duplicate issue #1195: Smearing for molecules can make SCF unstable. 
Created: 2022-02-22T19:06:56Z
I have been trying to use smearing on a Vanadium-containing compound for an numerical experiment, but I found that, although I could converge the molecule without smearing just fine, even a small amount of smearing made the SCF non-convergent.
I was able to approximately replicate the issue in some simpler atomic calculations. It seems that the issue is somewhat system dependent, from my experimentation.
(edited to fix a superficial bug)
from pyscf.gto import M
from pyscf.scf import ROHF
from pyscf.scf.addons import smearing_
HA = 27.211386024367243

mol = M(
    atom = 'V 0 0 0',  # in Angstrom
    basis = 'ccpvdz',
    spin = 3,
    symmetry = False,
)

myhf = ROHF(mol)
myhf.verbose = 4 
myhf.kernel()

myhf.analyze()

smearhf = smearing_(myhf, sigma=0.001/HA, method='gauss')
smearhf.max_cycle = 200 
smearhf.kernel()

smearhf.analyze()

The result of this script, for me, is that the calculation without smearing converges much faster than the one with some 0.1 eV smearing. Even with 0.001 eV smearing, the calculation remains fairly unstable.
My question is: is this a bug in molecular smearing, or is this an issue with using smearing on this system? Quantum Espresso seems to actually benefit from using smearing on this system, for what it's worth.

Closing comment (2024-08-11T04:34:53Z): The ROHF calculation converges to a spherical symmetry broken state. Using a relative large sigma, such as 0.01 Hartree, can converge to a result with spherical symmetry. This issue is related to #2289 .  It should have been fixed in PR #2356 .
Repository: pyscf/pyscf

Issue #496: Nonadiabatic Couplings
Created: 2020-01-20T02:37:16Z
Hi !
Is nonadiabatic couplings available ? If not it would be great to have them.

Duplicate issue #1414: Is nonadiabatic couplings available?
Created: 2022-09-08T16:41:52Z
Is nonadiabatic couplings available?

Closing comment (2022-09-09T09:34:58Z): Same as #496
Repository: pyscf/pyscf

Issue #1878: Unexpected multicollinear DFT energy in PySCF-2.3.0
Created: 2023-09-25T06:50:58Z
Hi, I am trying to calculate the energy of certain atoms using the "mcol" functional in PySCF. However, the results I got from this approach differ significantly from those obtained from the "col" and "ncol" methods, while the pyMC module gives the reasonable outputs. There appear to be some bugs in the calculation of $E_\text{xc}^\text{MC}$ in the latest PySCF. Below are some details about my test.
Results from PySCF
from pyscf import gto, scf
mol = gto.M()
mol.atom = '5' # just take boron as an example
mol.spin = 1
mol.basis = 'cc-pvdz'
mol.verbose = 5
mol.build()

mf = scf.GKS(mol)
mf.kernel()
# converged SCF energy = -24.3492647963336  <S^2> = 0.75127893  2S+1 = 2.0012785

mf.collinear = 'ncol'
mf.kernel()
# converged SCF energy = -24.3492647959041  <S^2> = 0.75127893  2S+1 = 2.0012785

mf.collinear = 'mcol'
mf.kernel()
# converged SCF energy = -124.197902208194  <S^2> = 0.75127893  2S+1 = 2.0012785
Results from pyMC
# --snip--
from pyMC import gksmc
mf = gksmc.GKSMC(mol)
mf.kernel()
# converged SCF energy = -24.3492647961974  <S^2> = 0.75127893  2S+1 = 2.0012785

Duplicate issue #1832: Unphysical energy in multicollinear dft
Created: 2023-08-14T20:53:34Z
Hi, I tried out the multicollinear functional in pyscf interfaced with mcfun recently. The energy I got for a few simple systems deviates from their conventional dft energy by tens to hunders of Hartree as described in mcfun's repository Multi-collinear/MCfun#4. All tests related to mcfun gks also failed. It's not reflected in pyscf's ci/cd process probably due to if mcfun is not installed then these test will be skipped.

Closing comment (2023-10-10T05:43:14Z): Related to #1878 . Should be fixed with new MCfun.
Repository: pyscript/pyscript

Issue #2007: print(...) + input() does not work as expected
Created: 2024-03-26T09:11:24Z
Checklist

 I added a descriptive title
 I searched for other issues and couldn't find a solution or duplication
 I already searched in Google and didn't find any good information or help

What happened?
Running the following Python code in pyscript terminal
print('anything')
a = input()
results as
anything
anything

So whenever an empty input is placed after print(), the argument of print function is logged twice
What browsers are you seeing the problem on? (if applicable)
No response
Console info
no console errors
Additional Context
version 2024.3.1

Duplicate issue #2147: Creating a new line "\n" within an input duplicates the input line
Created: 2024-08-19T20:14:21Z
Checklist

 I added a descriptive title
 I searched for other issues and couldn't find a solution or duplication
 I already searched in Google and didn't find any good information or help

What happened?
When trying to run an interactive terminal I am facing an issue of any input line with a new line character "\n" being duplicated on the terminal
<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="https://pyscript.net/releases/2024.8.2/core.css">
    <script type="module" src="https://pyscript.net/releases/2024.8.2/core.js"></script>
</head>
<body>
    <script type="py" terminal worker>
        name = input("What is your name?\n")
    </script>        
</body>


I have tried multiple versions of PyScript including 2024.4.1, 2024.7.1, 2024.8.1, 2024.8.2. Any help would be greatly appreciated!
What browsers are you seeing the problem on? (if applicable)
Firefox, Chrome, Microsoft Edge
Console info
No response
Additional Context
No response

Closing comment (2024-08-25T10:29:00Z): This bug looks similar to #2007
Repository: pyscript/pyscript

Issue #76: Make pyscript.write replace content instead of append
Created: 2022-05-01T02:58:04Z
I believe <py-script output="plot">...</py-script> should replace the contents of the plot element instead of appending.
That would make it easy to display a loading indicator as content until pyscript has loaded and run the script.

Duplicate issue #103: When using `print(arg1, arg2)` the output shows up on separate lines
Created: 2022-05-01T19:38:38Z
This is an inconsistency from the behavior of the regular Python interpreter.
For example, in a regular Python interpreter, this will be the result of
print("Hello", "world"):

The following is the equivalent using pyscript:
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1" />

    <title>PyScript Hello World</title>

    <link rel="icon" type="image/png" href="favicon.png" />
    <link rel="stylesheet" href="https://pyscript.net/unstable/pyscript.css" />
    
    <script defer src="https://pyscript.net/unstable/pyscript.js"></script>
  </head>

  <body>
    <py-env>
    </py-env>
    <py-script output="out">
print("Hello", "world")
    </py-script>
    <div id="out"></div>
  </body>
</html>

This shows up in the HTML as:

This is because every argument is output to a separate div element in the HTML:

This will make Python output from code that expects it to be compact to spread out across multiple lines.
Thanks to @khorn for his help with coming up with a reproducible example and writing it up.

Closing comment (2022-05-04T01:50:00Z): thanks for reporting @moshez  and @JeffersGlass  for trying to figure out the underlying issue. That's correct, there are some opinionated design choices that are causing the issue. In reality, this is a bug and the design we want to implement should allow users to configure how they actually would like this to behave. (For instance, appending vs overwriting to an output div).
This is related to #76 but shouldn't be a duplicate.
Repository: pyscript/pyscript

Issue #1142: Error dialog is not resizing correctly
Created: 2023-02-03T21:50:49Z
Checklist

 I added a descriptive title
 I searched for other issues and couldn't find a solution or duplication
 I already searched in Google and didn't find any good information or help

What happened?
Not sure what's the best approach to fix this but this should probably be responsive:

What browsers are you seeing the problem on? (if applicable)
No response
Console info
No response
Additional Context
No response

Duplicate issue #1299: Broken CSS for text in errors
Created: 2023-03-21T13:41:47Z
Checklist

 I added a descriptive title
 I searched for other issues and couldn't find a solution or duplication
 I already searched in Google and didn't find any good information or help

What happened?
See the picture:

The box is responsive but the text isn't.
I'm guessing we just have to add the same classes to the text that the box has?
What browsers are you seeing the problem on? (if applicable)
No response
Console info
Firefox
Additional Context
No response

Closing comment (2023-03-21T14:36:01Z): Is this the same as #1142 or a different thing?
Repository: pyscript/pyscript

Issue #412: [FEATURE]  REPL auto-generate functionality enhancement
Created: 2022-05-18T13:02:08Z
Is your feature request related to a problem? Please describe.
This issue is an extenction of PR #354 and Issue #188 .
As discussed with @fpliger and @marianoweber , This Issue is created to understand and discuss auto-generate functionlity of PY-REPL
Describe the solution you'd like
Understanding the requirement and general usage of PY-REPL and implementing auto-generate.
Describe alternatives you've considered
None Yet
Additional context
Not applicable

Duplicate issue #188: REPL autogenerate=false doesn't work
Created: 2022-05-04T14:56:01Z
REPL seems to fully ignore the attribute and generates a new REPL anyway

Closing comment (2022-06-03T13:58:48Z): I think I'll close this one as dup of #412. Let's use that other issue to discuss this. (If this is still reproducible... I tried quickly to understand the problem around this but I couldn't. Will try to tackle it later today.)
Repository: pyscript/pyscript

Issue #427: Suddenly my page not getting rendered, I am using PyScript link.
Created: 2022-05-19T15:19:57Z
I am working on this project since yesterday and everything was fine until now. Now I am getting text inside PyScript tag as output.
Before:

Now:

Console now:

Am I making any mistake?

Duplicate issue #429: [BUG] I can't use it now... It was working yesterday.
Created: 2022-05-19T16:31:26Z
link: http://www.dotcs.community/PyScript/DCSSDP.html
I didn't change my .html file.
Here are some screenshots:
2022.05.15:


Now:

Closing comment (2022-05-19T16:47:17Z): Duplicate of #427
Repository: pyscript/pyscript

Issue #581: Add documentation on how to run PyScrip offline and the limitations of it 
Created: 2022-07-07T21:02:20Z

Duplicate issue #1053: Without the Internet
Created: 2022-12-16T09:14:53Z
Checklist

 I added a descriptive title
 I searched for other feature requests and couldn't find a duplicate (including also the type-feature tag)
 I confirmed that it's not related to another project area (see the above section)

What is the idea?
Is it possible that the offline feature of this project can be implemented, that is, the user can run Python codes without internet, of course, it should be noted that we import the required libraries.
Why is this needed
No response
What should happen?
No response
Additional Context
No response

Closing comment (2023-01-02T19:51:29Z): Hi!
It is possible this is a dup of #581 so I'm going to close it to the benefit of having a centralized discussion. Let's move it there, I think Paul has an update on it.
cheers and thanks for opening the issue
Repository: pyscript/pyscript

Issue #810: Don't hide undefined elements in the CSS
Created: 2022-09-30T22:04:32Z
Currently we have this CSS rule:

  
    
      pyscript/pyscriptjs/src/styles/pyscript_base.css
    
    
        Lines 1 to 3
      in
      8f8b4b1
    
  
  
    

        
          
           :not(:defined) { 
        

        
          
               display: none 
        

        
          
           } 
        
    
  


I imagine that its goal is to make sure that the various <py-*> tags are not displayed until the various customElements.define(...) calls are made.
However, this opens the door to a lot of potential headaches: if an user make a typo and write e.g. <py-scrpt> or similar, they will get ignored and hidden, so the user will have a very hard time to understand what's happening.
A similar problem might happen with plugins/custom widgets: if an user uses <py-foo> but forgets to enable the foo plugin, the tag will be silently ignored.
I think that a better solution would be to write explicit :not(:defined) clauses for every tag that we want to actively hide.

Duplicate issue #296: Python script in <py-script> content may render before script execution
Created: 2022-05-09T07:04:06Z
Hi!
Interesting project!
I didn't try to set it up but looking at getting started it seems that a small browser behavior was overlooked.
Since HTML could render without fully loaded and <script defer> only executes right before HTML was full loaded, the way the page is set up as suggested in the tutorial means with slow enough connection or large enough script text, browser may render the Python script on the page before JS execution & custom element registration.
One can avoid that by only construct <py-script> dynamically... but that's less preferable since people should be able to embed the Python script declaratively in HTML.
The mitigation I can think of is to wrap the Python code in comment blocks (<!-- -->). This was actually done for JS too, when <script> was first introduced: web devs were told to wrap JS in comment blocks to avoid old browsers without support of <script> from putting JS onscreen1. To this day, HTML5 parser could parse and execute JS wrapped in comment.
It would be nice if pyscript can also pull Python code in the comment node child in <py-script>, other than the text node child, and update the tutorial as such. This would apply to other custom elements as well.
Thanks!
1: I have never encountered a browser that would do that, except for Mobile IE 2 on a really old WinCE device 😅

Closing comment (2022-10-04T15:38:12Z): I think it's good to leave closed, but I think it's more closely related to #810 - that issue is essentially looking to tidy up the solution proposed earlier in this issue.
Repository: pyscript/pyscript

Issue #123: Add section about security in WASM to the FAQ
Created: 2022-05-02T17:46:11Z
In security settings, through HTML injection, it would be possible to obtain information related to the host that has the py-script resources.
<html>
   <head>
      <link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
      <script defer src="https://pyscript.net/alpha/pyscript.js"></script>
   </head>
   <body>
      <py-script>
print("+-----------------------------------------+")
print('[+] PoC py-script')
print("+-----------------------------------------+")

import os
print("[+] Make dir and list")
os.mkdir('blueteam')
os.mkdir('poc')
os.mkdir('jhere')
os.listdir(os.getcwd())
      </py-script>
      <py-script>
print("+-----------------------------------------+")
print("[+] Print user loged")
print("+-----------------------------------------+")
os.getlogin()
      </py-script>
          <py-script>
print("+-----------------------------------------+")
print("[+] OS information")
print("+-----------------------------------------+")
os.uname()
          </py-script>
   </body>
</html>

Output:
+-----------------------------------------+
[+] PoC py-script
+-----------------------------------------+
[+] Make dir and list
['blueteam', 'poc', 'jhere']
+-----------------------------------------+
[+] Print user loged
+-----------------------------------------+
web_user
+-----------------------------------------+
[+] OS information
+-----------------------------------------+
posix.uname_result(sysname='Emscripten', nodename='emscripten', release='1.0', version='#1', machine='wasm32')

Duplicate issue #170: Remote file reading [Python Source Code] (Security Flaw)
Created: 2022-05-03T21:12:54Z
Hi there,
Thanks a lot for your awesome project, to be honest I expect that this project will blow the tech industry!! god job. According to my role as a security researcher I decided to test this awesome project and found that this Framework is affected with remote file reading as explained in the PoC:
[https://cyber-guy.gitbook.io/cyber-guy/pocs/pyscript-file-read]
So, I didn't even installed python 3.10 in my system but I can read its files from the remote system which is very dangerous flaw to be exists in this great project!
Thank you and if you wanna any help fixing this I'm always here!
Kind Regards

Closing comment (2022-05-03T21:45:18Z): Thanks for raising this concern @rth but as @rth points out all you are accessing is the sandboxed filesystem in the browser. Therefore I'll close as a duplicate of #123.
Repository: pytest-dev/pytest-asyncio

Issue #168: Release 0.14 breaks tests that rely on a specific event_loop_policy
Created: 2020-06-25T12:22:02Z
Problem
We have many testcases that rely on asyncio.set_event_loop_policy(AnyThreadEventLoopPolicy())
We set the event loop policy in the conftest.py, such that it is set before any tests start.
Since 0.14 these testcases produce errors
RuntimeError: There is no current event loop in thread 'ThreadPoolExecutor-109_6'.

Root cause
The change here: https://github.com/pytest-dev/pytest-asyncio/pull/164/files#diff-4d85e8313d8e67cb777137411a11ac86R80
Resets the event loop policy after the first test, breaking all the next tests.

Duplicate issue #188: 0.14 overrides event loop choice and breaks tests
Created: 2020-09-22T23:12:16Z
Bokeh relies on Tornado which is incompatible with the default Proactor event loop on Windows starting with Python 3.8.
Accordingly, we call this function
def fixup_windows_event_loop_policy() -> None:
    if sys.platform == 'win32' and sys.version_info[:3] >= (3, 8, 0):
        import asyncio
        if type(asyncio.get_event_loop_policy()) is asyncio.WindowsProactorEventLoopPolicy:
            # WindowsProactorEventLoopPolicy is not compatible with tornado 6
            # fallback to the pre-3.8 default of WindowsSelectorEventLoopPolicy
            asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())


in any module that will need to use tornado. Since 0.14 became available, all our Tornado tests are failing, because the Proactor loop is being used in tests even despite our explicit event loop policy selection:

509
self = <ProactorEventLoop running=False closed=False debug=False>, fd = 2832
510
callback = <bound method BaseAsyncIOLoop._handle_events of <tornado.platform.asyncio.AsyncIOMainLoop object at 0x0000020E9CBDCB50>>
511
args = (2832, 1)

Is this intentional? is there some new way we should configure pytest-asyncio to be able to not override our policy selection?
ref: bokeh/bokeh#10514

Closing comment (2020-10-04T13:39:32Z): I believe this is a duplicate of #168
@bryevdv Can you check if this is the case and close this issue if applicable?
Repository: pytest-dev/pytest-asyncio

Issue #797: Not compatible with --doctest-modules --doctest-ignore-import-errors
Created: 2024-03-08T11:33:50Z
By default pytest does not import all modules so it is fine if they have import errors due to optional dependencies.
You can cause pytest to import all modules if you pass --doctest-modules. If some of your modules fail to import you will get collection failures
You can make pytest ignore those import errors using --doctest-ignore-import-errors.
This last point is apparently broken if pytest-asyncio is installed (it doesn't even have to be used). This doesn't make any sense to me but maybe the plugin interacts with pytest import logic in some way
I found this in an a larger codebase but was able to reproduce with a minimal gist repo. The test repo tries to run pytest --collect in two minimal containers based on python-alpine: one with pytest only and one with pytest-asyncio as well. The second run shows import errors.

Duplicate issue #729: pytest-asyncio-0.23.2 loads packages more eagerly
Created: 2023-12-24T11:01:13Z
In our case it is actually causing issues. In short, we have Python files in our tests dir that should only be loaded in a specific context. I'll elaborate in more detail below. We could probably work around it if we need to, but for now we have pinned pytest-asyncio to the previous version until this discussion reaches a conclusion.
Our specifix use case: we are developing a Python project with a plugin system. Put simply, these plugins are Python packages that register themselves at load time. They are expected to be loaded by a custom importlib finder/loader and they do not work as standalone package.
Since this plugin system is an integral part of the application we're developing, we test their behavior thoroughly. Therefore we have a bunch of these plugin "packages" as resources underneath our tests directory. They are meant as nothing more than data: our application will find and load them when appropriate. They will raise an error when loaded as a standalone package, which pytest v0.23 now does.
Originally posted by @sanderr in #713 (comment)

Closing comment (2024-07-15T13:13:53Z): @Mark90 I think your issue is tracked in #797.
Repository: python-geeks/Automation-scripts

Issue #26: Weather checker
Created: 2020-10-08T08:54:41Z
Script Title -  Able to check weather by any related API
what will change - Adding a script
Instructions

Create a new folder for your script and file/folder name should be appropriate.
Create a README.md in your folder for program Instructions
add requirements.txt if needed

Please add/delete options that are not relevant.

 Adding New Code

Programming Language

 Python

Happy Coding,

Duplicate issue #359: Add a weather news!
Created: 2021-08-19T07:09:41Z
Hi, you can also add the weather news in your project to look more realistic, and here is the sample code that you can add to your project.
Module needed:- json, requests
Note: User need to create an account on openweathermap.org then only can use the APIs
Python program to find current
weather details of any city
using openweathermap api
import required modules
import requests, json
Enter your API key here
api_key = "Your_API_Key"
base_url variable to store url
base_url = "http://api.openweathermap.org/data/2.5/weather?"
Give city name
city_name = input("Enter city name : ")
complete_url variable to store
complete url address
complete_url = base_url + "appid=" + api_key + "&q=" + city_name
get method of requests module
return response object
response = requests.get(complete_url)
json method of response object
convert json format data into
python format data
x = response.json()
Now x contains list of nested dictionaries
Check the value of "cod" key is equal to
"404", means city is found otherwise,
city is not found
if x["cod"] != "404":
# store the value of "main"
# key in variable y
y = x["main"]

# store the value corresponding
# to the "temp" key of y
current_temperature = y["temp"]

# store the value corresponding
# to the "pressure" key of y
current_pressure = y["pressure"]

# store the value corresponding
# to the "humidity" key of y
current_humidity = y["humidity"]

# store the value of "weather"
# key in variable z
z = x["weather"]

# store the value corresponding
# to the "description" key at
# the 0th index of z
weather_description = z[0]["description"]

# print following values
print(" Temperature (in kelvin unit) = " +
                str(current_temperature) +
      "\n atmospheric pressure (in hPa unit) = " +
                str(current_pressure) +
      "\n humidity (in percentage) = " +
                str(current_humidity) +
      "\n description = " +
                str(weather_description))

else:
print(" City Not Found ")

Closing comment (2021-08-19T07:28:43Z): Hey @Tanisha60, this is duplicate of #26
Repository: python-geeks/Automation-scripts

Issue #57: Color to black-n-while image
Created: 2020-10-08T15:10:22Z
Script Title - Script is able to change a color image to bw image (Can be done by cv2 library)
what will change - Adding script for that
Instructions

Create a new folder for your script and file/folder name should be appropriate.
Create a README.md in your folder for program Instructions
add requirements.txt if needed

Please add/delete options that are not relevant.

 Adding New Code

Programming Language

 Python

Happy Coding,

Duplicate issue #669: Grayscale Image Filter
Created: 2021-10-07T08:43:03Z
Script Title - Grayscale Image Filter
Brief - A filter to convert rgb images to grayscale
Instructions

Create a new folder for your script and file/folder name should be appropriate.
Create a README.md in your folder for program Instructions
add requirements.txt if needed

Programming Language

 Python

Happy Coding

Closing comment (2021-10-07T09:25:23Z): Duplicate of #57
Repository: python-geeks/Automation-scripts

Issue #216: Face mask detector
Created: 2020-10-11T11:05:07Z
Script Title - Quick example to solve the purpose
what will change - Adding a script
Instructions

Create a new folder for your script and the file/folder name should be appropriate.
Create a README.md in your folder for program Instructions
add requirements.txt if needed

Please add/delete options that are not relevant.

 Adding New Code

Programming Language

 Python

Happy Coding,

Duplicate issue #540: Mask Detection
Created: 2021-10-01T14:11:34Z
Script Title - Mask Detection
Brief -
I wanted to contribute to your repository Mask Detection using open cv and python
Instructions

Create a new folder for your script and file/folder name should be appropriate.
Create a README.md in your folder for program Instructions
add requirements.txt if needed

Programming Language

 Python

Happy Coding

Closing comment (2021-10-01T15:35:24Z): Hey, isn't it similar to #216 ?
Repository: python-geeks/Automation-scripts

Issue #495: Auto Backup the folder/folders
Created: 2021-10-01T03:06:57Z
Script Title - Script which takes the path and time to start backup
Brief -
Instructions

Create a new folder for your script and file/folder name should be appropriate.
Create a README.md in your folder for program Instructions
add requirements.txt if needed

Programming Language

 Python

Happy Coding

Duplicate issue #736: Backup of a folder into a zip file
Created: 2021-10-10T05:48:29Z
Script Title - Backup of a folder into zipfile
Instructions

Create a new folder for your script and file/folder name should be appropriate.
Create a README.md in your folder for program Instructions
add requirements.txt if needed

Programming Language

 Python

Also, I would like to work on this.

Closing comment (2021-10-10T05:53:36Z): Duplicate of #495
Repository: python-geeks/Automation-scripts

Issue #141: PDF merger
Created: 2020-10-09T17:44:49Z
Script Title - Script is able to merge all pdfs of directory
what will change - Adding PDF merger script
Instructions

Create a new folder for your script and file/folder name should be appropriate.
Create a README.md in your folder for program Instructions
add requirements.txt if needed

Please add/delete options that are not relevant.

 Adding New Code

Programming Language

 Python

Happy Coding,

Duplicate issue #752: Python script to merge PDFs
Created: 2021-10-11T08:11:03Z
Script Title -
PDF merger
Brief -
A python3 script to merge pdf files.
Instructions

Create a new folder for your script and file/folder name should be appropriate.
Create a README.md (using this template) in your folder for program Instructions
add requirements.txt if needed

Programming Language

 Python

Happy Coding

Closing comment (2021-10-11T09:37:12Z): Duplicate of #141
Repository: python-geeks/Automation-scripts

Issue #23: Email sender
Created: 2020-10-08T06:07:48Z
Script Title - Send an email on one's behalf
what will change - Adding email-sender script
Instructions

Create a new folder for your script and file/folder name should be appropriate.
Create a README.md in your folder for program Instructions
add requirements.txt if needed

Please add/delete options that are not relevant.

 Adding New Code

Programming Language

 Python

Happy Coding,

Duplicate issue #764: Django  Email Sender
Created: 2021-10-13T16:45:00Z
Script Title -Django Email Sender
Brief -
I want to add my project Django Email Sender using python.
Instructions

Create a new folder for your script and file/folder name should be appropriate.
Create a README.md (using this template) in your folder for program Instructions
add requirements.txt if needed

Programming Language

 Python

Happy Coding

Closing comment (2021-10-19T10:56:19Z): Duplicate of #23