text:
maximum-coverage-location package

I just came across this repo for solving the MCLP. We may (or may not) want to add it to README as a related project (if we include a Related Projects section as some point).

Agreed with Martin. But I think we can point it as a related project.

Greetings @jGaboardi @martinfleis @gegen07  - I thought I would hijack this thread. We didn't know about spopt until a a few days ago. We built a separate open source library to solve location allocation problems which you can find here. With pysal-spopt however around, we don't think it is the best idea to maintain it (I just made it public for you to be able to view it). We built logic for few different problems which we derived from ESRI's location allocation suite. The first one being basically the same as you found above, however rewritten to be able to use python-mip (which they actually all do). The "Maximize Capacitated Coverage" problem may be interesting for spopt as it considers the capacity of a facility. "Maximize Coverage and Minimize Cost" is probably very similar to P-Median and "Maximize Coverage and Minimize Facilities" similar to LCSP. They are however less intuitive to use as there are not very transparent weights which have to be passed in. I'd love to hear your thoughts on this.

Maximize Coverage: This problem is used to site facilities from candidate facilites covering the largest amount of demand points within a cost cutoff value.
Maximize Capacitated Coverage: This problem is used to site facilities from candidate capacity bound facilites covering the largest amount of demand points within a cost cutoff value.
Maximize Coverage and Minimize Cost: This problem is used to site facilities from candidate facilites covering the largest amount of demand points and minimizing the overall cost within a cost cutoff value.
Maximize Coverage and Minimize Facilities: This problem is used to site facilities from candidate facilites covering the largest amount of demand points within a cost cutoff value. The difference to maximize coverage is that the number of facilities to be sited does not have to be specified.

Very true, but it is a related project. My only motivation here was make a record of it; not suggest that we use it.

Agree here with James and Germano. Good to have a record of related projects. The content itself is quite simple as well.

Greetings @jGaboardi @martinfleis @gegen07 - I thought I would hijack this thread. We didn't know about spopt until a a few days ago. We built a separate open source library to solve location allocation problems which you can find here. With pysal-spopt however around, we don't think it is the best idea to maintain it (I just made it public for you to be able to view it). We built logic for few different problems which we derived from ESRI's location allocation suite. The first one being basically the same as you found above, however rewritten to be able to use python-mip (which they actually all do). The "Maximize Capacitated Coverage" problem may be interesting for spopt as it considers the capacity of a facility. "Maximize Coverage and Minimize Cost" is probably very similar to P-Median and "Maximize Coverage and Minimize Facilities" similar to LCSP. They are however less intuitive to use as there are not very transparent weights which have to be passed in. I'd love to hear your thoughts on this.

Maximize Coverage: This problem is used to site facilities from candidate facilites covering the largest amount of demand points within a cost cutoff value.
Maximize Capacitated Coverage: This problem is used to site facilities from candidate capacity bound facilites covering the largest amount of demand points within a cost cutoff value.
Maximize Coverage and Minimize Cost: This problem is used to site facilities from candidate facilites covering the largest amount of demand points and minimizing the overall cost within a cost cutoff value.
Maximize Coverage and Minimize Facilities: This problem is used to site facilities from candidate facilites covering the largest amount of demand points within a cost cutoff value. The difference to maximize coverage is that the number of facilities to be sited does not have to be specified.

Hi Tim,
Thanks for hijack us! I would say thanks for sharing your repo and we are certainly keen to further improve our package. The next step of the development will certainly focus on adding the capacity measures in the model and also increasing the availability of other location modelling methods, such as the dispersion models.
Best,
Qunshan

Thanks @qszhao - appreciated. Would you generally be interested in some additional jupyter notebooks making it easier for GIS users to understand who are not savvy with matplotlib? Here is one example I wrote the other day - https://nbviewer.org/github/gis-ops/tutorials/blob/master/location-allocation/mclp/fossgiss22-marburg-spopt-demo.ipynb
I would be happy to contribute some of these to this repository.

@TimMcCauley, very cool example notebook!
@gegen07 @qszhao @ljwolf @martinfleis @xf37, maybe we should think about adding something like an External Examples section to the docs?

@TimMcCauley Would you be willing to give that notebook a bit of comments, translate variables into English and contribute it to spopt/notebooks?
@jGaboardi I guess we could have a section on external resources but if it is a single notebook, I'd be more keen to have it as a contribution to our docs.

I think either option would be nice, so I suppose it may come down to whether @TimMcCauley wants to contribute the example to become part of spopt or simply provide a link to where the notebook/gist is located. In a similar vein, the facility location tutorial in spaghetti was (is) featured as an external example in the docs for python-mip prior to our creation of spopt.

Thanks - I am happy to contribute. I will update the notebook with comments and also add 3 more for the remaining models LSCP, P-Median and P-Center over the next few weeks.

Very nice to have your contribution @TimMcCauley!

xref #221

I think we start either a bullet list or table in the README as was to address this for now. I'll get to that soon.

Resolve in #288

authors: TimMcCauley gegen07 jGaboardi martinfleis qszhao

repo: pysal/spopt


text:
attempt 3.9 testing

This PR is the initial attempt to support Python 3.9 for CI testing.

See original PR in #71.

Dependencies not yet there for 3.9. Leaving this open for now and will check back periodically.
Looks like the specific failure here is:
numpy[version='>=1.3'] -> blas=[build=mkl] -> liblapacke==3.8.0[build='4_mkl|5_mkl|6_mkl|9_mkl|11_mkl|14_mkl|16_mkl|21_mkl|20_mkl|19_mkl|18_mkl|15_mkl|13_mkl|12_mkl|10_mkl|8_mkl|7_mkl']

how come we're pinning scikit to 0.22?

how come we're pinning scikit to 0.22?

how come we're pinning scikit to 0.22?

No idea. Let's try without a pinned version?

how come we're pinning scikit to 0.22?

No idea. Let's try without a pinned version?

this is supreceded by #95

this is supreceded by #95

source: gharchive/pull-request

authors: jGaboardi knaaptime

license_type: permissive

license_source: github-api


text:
Dependent libraries in libmcscf

Fix issue #1175 and #1118

Can confirm that this fixes it.

Thanks!
Are you planning on creating a release with that soon or should I just continue patching this on my side for now?

authors: BastianZim sunqm

repo: pyscf/pyscf


text:
Adds make_rdm2 to RHF and UHF

Mean-field 2-RDMs factorize into products of the 1-RDM, so typically we don't care to build them,
but sometimes I find it useful to have them at hand to quickly compare to correlated results, etc.
For this reason I suggest to add make_rdm2 methods to the SCF classes.

please fix lint errors. thanks

please fix lint errors. thanks

Done. But do we really think that
dm2aa = (numpy.einsum('ij,kl->ijkl', dm1a, dm1a)
         - numpy.einsum('ij,kl->iklj', dm1a, dm1a))
dm2bb = (numpy.einsum('ij,kl->ijkl', dm1b, dm1b)
         - numpy.einsum('ij,kl->iklj', dm1b, dm1b))

is easier to read than
dm2aa = (numpy.einsum('ij,kl->ijkl', dm1a, dm1a)
       - numpy.einsum('ij,kl->iklj', dm1a, dm1a))
dm2bb = (numpy.einsum('ij,kl->ijkl', dm1b, dm1b)
       - numpy.einsum('ij,kl->iklj', dm1b, dm1b))

?

I think your old format looks better. Could you add E128 to the session "ignore" in pyscf/.flake8 configure?

I think your old format looks better. Could you add E128 to the session "ignore" in pyscf/.flake8 configure?

OK, done

authors: Majokux fishjojo sunqm


text:
psc module not found when running make test

Checklist

[X] I added a descriptive title
[X] I searched for other issues and couldn't find a duplication

What is the issue/comment/problem?
Hi! I have been following the requirements for committing examples to this repository. However i have ran into an issue. When i run: make test i get this issue [ *screenshot attatched ]:

however, as you can also observe on the screenshot, the pcs module is actually installed. The system can't seem to find the module psc.
i created a conda environment, and operated via these commands:

conda create --name env
conda install -n env python
conda activate env
make test
what might the issue be here?? because when i run my project locally, everything seems to be okay, and working properly.

Hi, as you're the only one that's made important contributions here, I'd like to catch you up on some discussion and get your opinion.
Clearly this PSC idea hasn't gone anywhere. Partly due to my inactivity, but also because the idea is likely flawed. I've come to realize the better course is to be contributors in the main repo, helping on those examples and linking to others.
How would you feel about you and I going that route?

source: gharchive/issue

repo: pyscript/pyscript-collective


text:
key_pressed does not get correctly converted

From Discord:

I have if keypressed "a" in my scratch block and it is converted to
if self.key_pressed("NO TRANSLATION: sensing_keyoptions"):
If I manually change "NO TRANSLATION: sensing_keyoptions" to "a", then it works.

Reproduced it. The block is actually more complicated than I thought, as you can switch the default key menu for something like a variable that contains the key to be pressed:

In our intermediate representation, this is how it looks:
                    "opcode": "sensing_keypressed",
                    "params": {
                      "KEY_OPTION": {
                        "opcode": "sensing_keyoptions",
                        "params": {
                          "KEY_OPTION": "\"a\""
                        },
                      }

Compared to "when key is pressed (hat block)":
          "opcode": "event_whenkeypressed",
          "params": {
            "KEY_OPTION": "\"space\""
          },

This affects other blocks as well, such as "distance to...". They contain sensing blocks that are not available outside these blocks, but can be replaced. So the easiest solution seems to be to implement these blocks so that PyStage knows about them.

repo: pystage/pystage

license: MIT


text:
INTERNALERROR /path/to/file is not in the subpath of '\/path/to/file'

Describe the bug

In unit testing, I need to emulate a Windows OS.  My base machine is macOS.
When using pyfakefs.fake_filesystem.OSType.WINDOWS + tempfile + --log-cli-level=DEBUG, I get the below internal error.
How To Reproduce
import tempfile

import pyfakefs.fake_filesystem

def test_foo(fs) -> None:
    fs.os = pyfakefs.fake_filesystem.OSType.WINDOWS

    with tempfile.TemporaryDirectory():
        pass

Outputs the following:
> pytest test/repo/test/test_play.py -s --log-cli-level=DEBUG
=============================================================================================================== test session starts ===============================================================================================================
platform darwin -- Python 3.10.9, pytest-7.2.2, pluggy-1.0.0
rootdir: /Users/user/code/repo/test, configfile: pyproject.toml
plugins: pyfakefs-5.2.2, mock-3.10.0, subtests-0.10.0
collected 1 item

test/repo/test/test_play.py::test_foo
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/main.py", line 270, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/main.py", line 324, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__
INTERNALERROR>     return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/main.py", line 349, in pytest_runtestloop
INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__
INTERNALERROR>     return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/runner.py", line 112, in pytest_runtest_protocol
INTERNALERROR>     runtestprotocol(item, nextitem=nextitem)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/runner.py", line 131, in runtestprotocol
INTERNALERROR>     reports.append(call_and_report(item, "call", log))
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/runner.py", line 224, in call_and_report
INTERNALERROR>     hook.pytest_runtest_logreport(report=report)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__
INTERNALERROR>     return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/terminal.py", line 551, in pytest_runtest_logreport
INTERNALERROR>     line = self._locationline(rep.nodeid, *rep.location)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/terminal.py", line 878, in _locationline
INTERNALERROR>     res = mkrel(nodeid)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/terminal.py", line 868, in mkrel
INTERNALERROR>     line = self.config.cwd_relative_nodeid(nodeid)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1104, in cwd_relative_nodeid
INTERNALERROR>     nodeid = bestrelpath(self.invocation_params.dir, fullpath)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/pathlib.py", line 710, in bestrelpath
INTERNALERROR>     reldirectory = directory.relative_to(base)
INTERNALERROR>   File "/Users/user/.pyenv/versions/3.10.9/lib/python3.10/pathlib.py", line 818, in relative_to
INTERNALERROR>     raise ValueError("{!r} is not in the subpath of {!r}"
INTERNALERROR> ValueError: '/Users/user/code/repo' is not in the subpath of '\\/Users/user/code/repo' OR one path is relative and the other is absolute.
Traceback (most recent call last):
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pyfakefs/fake_filesystem.py", line 1618, in get_object_from_normpath
    target = target.get_entry(component)  # type: ignore
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pyfakefs/fake_file.py", line 542, in get_entry
    return self.entries[to_string(pathname_name)]
KeyError: 'Users'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/user/code/repo/venv/bin/pytest", line 8, in <module>
    sys.exit(console_main())
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 190, in console_main
    code = main()
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 167, in main
    ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
    return outcome.get_result()
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/main.py", line 317, in pytest_cmdline_main
    return wrap_session(config, _main)
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/main.py", line 302, in wrap_session
    os.chdir(session.startpath)
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pyfakefs/fake_os.py", line 1354, in wrapped
    return f(*args, **kwargs)
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pyfakefs/fake_os.py", line 421, in chdir
    self.filesystem.confirmdir(path)
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pyfakefs/fake_filesystem.py", line 2810, in confirmdir
    self.resolve(target_directory, check_owner=check_owner),
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pyfakefs/fake_filesystem.py", line 1692, in resolve
    return self.get_object_from_normpath(
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pyfakefs/fake_filesystem.py", line 1627, in get_object_from_normpath
    self.raise_os_error(errno.ENOENT, path)
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pyfakefs/fake_filesystem.py", line 418, in raise_os_error
    raise OSError(err_no, message, filename)
FileNotFoundError: [Errno 2] No such file or directory in the fake filesystem: 'C:\\Users\\user\\code\\repo'

Your environment

I have pyfakefs==5.2.2.  Note the current version printing from the issue template is broken.
> python -c "import platform; print(platform.platform())"
macOS-12.6-arm64-arm-64bit
> python -c "import sys; print('Python', sys.version)"
Python 3.10.9 (main, Jan  6 2023, 11:19:20) [Clang 14.0.0 (clang-1400.0.29.102)]
> python -c "from pyfakefs.fake_filesystem import __version__; print('pyfakefs', __version__)"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: cannot import name '__version__' from 'pyfakefs.fake_filesystem' (/Users/user/proj/proj_venv/lib/python3.10/site-packages/pyfakefs/fake_filesystem.py)
> python -c "import pytest; print('pytest', pytest.__version__)"
pytest 7.2.2

Thanks for the report!
The cross-os functionality of pyfakefs is not perfect, and mostly only used in our own tests, so there are certainly issues.
In this case it has probably to do with the different location of temp directories, though I have to have a closer look later.
As for the broken issue template - I actually noticed this in the last bug report, but forgot to check it out. Thanks for the reminder!

Yeah thank you!  Sounds good.
I also came up with a simpler repro today, simply setting the fs.os to Windows:
import pyfakefs.fake_filesystem

def test_foo(fs) -> None:
    fs.os = pyfakefs.fake_filesystem.OSType.WINDOWS

Running like this yields the error:
> pytest test/repo/test/test_play.py -s --log-cli-level=DEBUG
=============================================================================================================== test session starts ===============================================================================================================
platform darwin -- Python 3.10.9, pytest-7.2.2, pluggy-1.0.0
rootdir: /Users/user/code/repo/test, configfile: pyproject.toml
plugins: pyfakefs-5.2.2, mock-3.10.0, subtests-0.10.0
collected 1 item

test/repo/test/test_play.py::test_foo
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/main.py", line 270, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/main.py", line 324, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__
INTERNALERROR>     return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/main.py", line 349, in pytest_runtestloop
INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__
INTERNALERROR>     return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/runner.py", line 112, in pytest_runtest_protocol
INTERNALERROR>     runtestprotocol(item, nextitem=nextitem)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/runner.py", line 131, in runtestprotocol
INTERNALERROR>     reports.append(call_and_report(item, "call", log))
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/runner.py", line 224, in call_and_report
INTERNALERROR>     hook.pytest_runtest_logreport(report=report)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__
INTERNALERROR>     return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/terminal.py", line 551, in pytest_runtest_logreport
INTERNALERROR>     line = self._locationline(rep.nodeid, *rep.location)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/terminal.py", line 878, in _locationline
INTERNALERROR>     res = mkrel(nodeid)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/terminal.py", line 868, in mkrel
INTERNALERROR>     line = self.config.cwd_relative_nodeid(nodeid)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1104, in cwd_relative_nodeid
INTERNALERROR>     nodeid = bestrelpath(self.invocation_params.dir, fullpath)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/pathlib.py", line 710, in bestrelpath
INTERNALERROR>     reldirectory = directory.relative_to(base)
INTERNALERROR>   File "/Users/user/.pyenv/versions/3.10.9/lib/python3.10/pathlib.py", line 818, in relative_to
INTERNALERROR>     raise ValueError("{!r} is not in the subpath of {!r}"
INTERNALERROR> ValueError: '/Users/user/code/repo' is not in the subpath of '\\/Users/user/code/repo' OR one path is relative and the other is absolute.
Traceback (most recent call last):
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pyfakefs/fake_filesystem.py", line 1618, in get_object_from_normpath
    target = target.get_entry(component)  # type: ignore
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pyfakefs/fake_file.py", line 542, in get_entry
    return self.entries[to_string(pathname_name)]
KeyError: 'Users'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/user/code/repo/venv/bin/pytest", line 8, in <module>
    sys.exit(console_main())
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 190, in console_main
    code = main()
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 167, in main
    ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
    return outcome.get_result()
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/main.py", line 317, in pytest_cmdline_main
    return wrap_session(config, _main)
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/main.py", line 302, in wrap_session
    os.chdir(session.startpath)
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pyfakefs/fake_os.py", line 1354, in wrapped
    return f(*args, **kwargs)
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pyfakefs/fake_os.py", line 421, in chdir
    self.filesystem.confirmdir(path)
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pyfakefs/fake_filesystem.py", line 2810, in confirmdir
    self.resolve(target_directory, check_owner=check_owner),
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pyfakefs/fake_filesystem.py", line 1692, in resolve
    return self.get_object_from_normpath(
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pyfakefs/fake_filesystem.py", line 1627, in get_object_from_normpath
    self.raise_os_error(errno.ENOENT, path)
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pyfakefs/fake_filesystem.py", line 418, in raise_os_error
    raise OSError(err_no, message, filename)
FileNotFoundError: [Errno 2] No such file or directory in the fake filesystem: 'C:\\Users\\user\\code\\repo'

Ok, I think I know what the problem is - I think this is actually a regression.
On resetting the file system on changing the OS the temp is not recreated, which seem to cause the problem. I will see if I can think ths in the next days.

If this is a regression, what was the previous code that was creating a temporary directory and adding a symlink to the fake filesystem, as is suggested for the pull request?

The code to create the temp directory previously was in the patcher. The regression happened because I added a filesystem reset in the os setters, and this removed the temp directory.

I am just giving this a whirl right now!  I don't know that #818 actually fixed the issue though.  I am still getting the same Exception.  I first cloned the current main branch (right after #818).
> pip install ~/code/pyfakefs
Looking in indexes: https://pypi.org/simple
Processing /Users/user/code/pyfakefs
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pyfakefs
  Building wheel for pyfakefs (pyproject.toml) ... done
  Created wheel for pyfakefs: filename=pyfakefs-5.3.dev0-py3-none-any.whl size=205504 sha256=blah
  Stored in directory: /private/var/folders/78/blah/T/pip-ephem-wheel-cache-or80khnp/wheels/17/ef/87/blah
Successfully built pyfakefs
Installing collected packages: pyfakefs
Successfully installed pyfakefs-5.3.dev0

With this file:
import pyfakefs.fake_filesystem

def test_foo(fs) -> None:
    fs.os = pyfakefs.fake_filesystem.OSType.WINDOWS

Running like so:
> pytest test/repo/test/test_play.py -s --log-cli-level=DEBUG
=============================================================================================================== test session starts ===============================================================================================================
platform darwin -- Python 3.10.9, pytest-7.3.1, pluggy-1.0.0
rootdir: /Users/user/code/repo/test
configfile: pyproject.toml
plugins: pyfakefs-5.3.dev0, mock-3.10.0, subtests-0.10.0
collected 1 item

test/repo/test/test_play.py::test_foo
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/main.py", line 269, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/main.py", line 323, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__
INTERNALERROR>     return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/main.py", line 348, in pytest_runtestloop
INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__
INTERNALERROR>     return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/runner.py", line 114, in pytest_runtest_protocol
INTERNALERROR>     runtestprotocol(item, nextitem=nextitem)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/runner.py", line 133, in runtestprotocol
INTERNALERROR>     reports.append(call_and_report(item, "call", log))
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/runner.py", line 226, in call_and_report
INTERNALERROR>     hook.pytest_runtest_logreport(report=report)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__
INTERNALERROR>     return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/terminal.py", line 557, in pytest_runtest_logreport
INTERNALERROR>     line = self._locationline(rep.nodeid, *rep.location)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/terminal.py", line 882, in _locationline
INTERNALERROR>     res = mkrel(nodeid)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/terminal.py", line 872, in mkrel
INTERNALERROR>     line = self.config.cwd_relative_nodeid(nodeid)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1110, in cwd_relative_nodeid
INTERNALERROR>     nodeid = bestrelpath(self.invocation_params.dir, fullpath)
INTERNALERROR>   File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/pathlib.py", line 741, in bestrelpath
INTERNALERROR>     reldirectory = directory.relative_to(base)
INTERNALERROR>   File "/Users/user/.pyenv/versions/3.10.9/lib/python3.10/pathlib.py", line 818, in relative_to
INTERNALERROR>     raise ValueError("{!r} is not in the subpath of {!r}"
INTERNALERROR> ValueError: '/Users/user/code/repo' is not in the subpath of '\\/Users/user/code/repo' OR one path is relative and the other is absolute.
Traceback (most recent call last):
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pyfakefs/fake_filesystem.py", line 1628, in get_object_from_normpath
    target = target.get_entry(component)  # type: ignore
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pyfakefs/fake_file.py", line 542, in get_entry
    return self.entries[to_string(pathname_name)]
KeyError: 'Users'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/user/code/repo/venv/bin/pytest", line 8, in <module>
    sys.exit(console_main())
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 189, in console_main
    code = main()
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 166, in main
    ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
    return outcome.get_result()
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/main.py", line 316, in pytest_cmdline_main
    return wrap_session(config, _main)
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/_pytest/main.py", line 301, in wrap_session
    os.chdir(session.startpath)
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pyfakefs/fake_os.py", line 1354, in wrapped
    return f(*args, **kwargs)
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pyfakefs/fake_os.py", line 421, in chdir
    self.filesystem.confirmdir(path)
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pyfakefs/fake_filesystem.py", line 2820, in confirmdir
    self.resolve(target_directory, check_owner=check_owner),
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pyfakefs/fake_filesystem.py", line 1702, in resolve
    return self.get_object_from_normpath(
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pyfakefs/fake_filesystem.py", line 1637, in get_object_from_normpath
    self.raise_os_error(errno.ENOENT, path)
  File "/Users/user/code/repo/venv/lib/python3.10/site-packages/pyfakefs/fake_filesystem.py", line 428, in raise_os_error
    raise OSError(err_no, message, filename)
FileNotFoundError: [Errno 2] No such file or directory in the fake filesystem: 'C:\\Users\\user\\code\\repo'

Any ideas?

That is strange, because

I just noticed that the pytest tests run only under Linux and Windows, so the added tests are not run under macOS. As I don't have a Mac, I can only rely on the CI tests. I would have thought that Posix systems behave the same in that respect, but I was obviously wrong.

I first cloned the current main branch (right after https://github.com/pytest-dev/pyfakefs/pull/818).

You mean after it was merged, right?
Anyway, I will have another look tonight, if I find the time, or tomorrow.

Hm, I added the tests in #820, and they all pass. The test in question is just:
def test_switch_to_windows(fs):
    fs.os = OSType.WINDOWS
    assert os.path.exists(tempfile.gettempdir())

which to me seems to be exactly what you are doing.
I will change the Python version from 3.9 to 3.10 to match your test (and it makes sense anyway) and see if that changes anything...

It did not, the tests all pass for macOS. Can you please check what may be different in your environment? I really have no idea how to test this without a Mac and without reproducibility in CI....

they actually failed for all OSes for all pytest versions < 6.2

I am using pytest version 7 with Python 3.10, so the 6.2 version is not my issue.

One important comment I can add is the INTERNALERROR does not trigger when outside of a native namespace package, it only triggers when part of a native namespace package.  Hence you see the pytest test/repo/test/test_play.py path above:

First test: folder in a monorepo
repo: native namespace
test/test_play.py path within native namespace package

This is the relevant trace in the INTERNALERROR stack:
INTERNALERROR>   File "/Users/user/.pyenv/versions/3.10.9/lib/python3.10/pathlib.py", line 818, in relative_to
INTERNALERROR>     raise ValueError("{!r} is not in the subpath of {!r}"
INTERNALERROR> ValueError: '/Users/user/code/repo' is not in the subpath of '\\/Users/user/code/repo' OR one path is relative and the other is absolute.

It looks like pathlib.relative_to is having some aspect of Windows base (\\) and some bleedthrough of macOS ('/Users/user/...).

Yes, I think you are right, and the problem here is indeed related to the mixup of different filesystem paths.
The thing is that the emulation of another OS in pyfakefs is not perfect anyway - there are more problems related to pathlib, and you can't completely rely on the behavior to be the same as on the native OS.
I may have to revisit the related code and think about how to make this better - this may take a bit, though...

@jamesbraza - I'm struggling to reproduce your problem, even with a namespace package, but maybe I'm doing something wrong. Have you by any chance a small reproducible failing example (could also be a repository), so I can be sure to test the correct thing?

@mrbean-bremen yeah sure, I can make one by 5/19/2023 (next Friday) 👌
Sorry I didn't have a more complete repro for this creation of this ticket, didn't realize it would be tough to reproduce

Thank you! I may just have made some dumb mistake, but as I don't have a Mac, it is good to have a reliable reproducable test that I can run via CI.

Okay @mrbean-bremen I have a working reproduction via macOS.  One thing that's important: using the --log-cli-level=DEBUG flag.  The error doesn't show up if not using that flag.
Control Group: Working
repo
└── test
    └── repo
        └── test
            └── test_file.py

Where test_file.py:
import pyfakefs.fake_filesystem

def test_foo(fs) -> None:
    fs.os = pyfakefs.fake_filesystem.OSType.WINDOWS

No errors, yay!
(venv) ➜  repo pytest --log-cli-level=DEBUG test
=============================================================================================================== test session starts ===============================================================================================================
platform darwin -- Python 3.10.9, pytest-7.3.1, pluggy-1.0.0
rootdir: /Users/user/code/repo
plugins: pyfakefs-5.2.2
collected 1 item

test/repo/test/test_file.py::test_foo PASSED                                                                                [100%]

================================================================================================================ 1 passed in 0.02s ================================================================================================================

Exposing the Bug
Now, let's break it 😈 by adding an empty test/setup.py:
repo
└── test
    ├── repo
    │   └── test
    │       └── test_file.py
    └── setup.py

(venv) ➜  repo pytest --log-cli-level=DEBUG test
=============================================================================================================== test session starts ===============================================================================================================
platform darwin -- Python 3.10.9, pytest-7.3.1, pluggy-1.0.0
rootdir: /Users/user/code/repo/test
plugins: pyfakefs-5.2.2
collected 1 item

test/repo/test/test_file.py::test_foo Traceback (most recent call last):
  File "/path/to/venv/lib/python3.10/site-packages/_pytest/main.py", line 269, in wrap_session
    session.exitstatus = doit(config, session) or 0
  File "/path/to/venv/lib/python3.10/site-packages/_pytest/main.py", line 323, in _main
    config.hook.pytest_runtestloop(session=session)
  File "/path/to/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "/path/to/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/path/to/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
    return outcome.get_result()
  File "/path/to/venv/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/path/to/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "/path/to/venv/lib/python3.10/site-packages/_pytest/main.py", line 348, in pytest_runtestloop
    item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
  File "/path/to/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "/path/to/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/path/to/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
    return outcome.get_result()
  File "/path/to/venv/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/path/to/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "/path/to/venv/lib/python3.10/site-packages/_pytest/runner.py", line 114, in pytest_runtest_protocol
    runtestprotocol(item, nextitem=nextitem)
  File "/path/to/venv/lib/python3.10/site-packages/_pytest/runner.py", line 133, in runtestprotocol
    reports.append(call_and_report(item, "call", log))
  File "/path/to/venv/lib/python3.10/site-packages/_pytest/runner.py", line 226, in call_and_report
    hook.pytest_runtest_logreport(report=report)
  File "/path/to/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "/path/to/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/path/to/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
    return outcome.get_result()
  File "/path/to/venv/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/path/to/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "/path/to/venv/lib/python3.10/site-packages/_pytest/terminal.py", line 557, in pytest_runtest_logreport
    line = self._locationline(rep.nodeid, *rep.location)
  File "/path/to/venv/lib/python3.10/site-packages/_pytest/terminal.py", line 882, in _locationline
    res = mkrel(nodeid)
  File "/path/to/venv/lib/python3.10/site-packages/_pytest/terminal.py", line 872, in mkrel
    line = self.config.cwd_relative_nodeid(nodeid)
  File "/path/to/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1110, in cwd_relative_nodeid
    nodeid = bestrelpath(self.invocation_params.dir, fullpath)
  File "/path/to/venv/lib/python3.10/site-packages/_pytest/pathlib.py", line 741, in bestrelpath
    reldirectory = directory.relative_to(base)
  File "/Users/user/.pyenv/versions/3.10.9/lib/python3.10/pathlib.py", line 818, in relative_to
    raise ValueError("{!r} is not in the subpath of {!r}"
ValueError: '/Users/user/code/repo' is not in the subpath of '\\/Users/user/code/repo' OR one path is relative and the other is absolute.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/path/to/venv/lib/python3.10/site-packages/_pytest/main.py", line 289, in wrap_session
    config.notify_exception(excinfo, config.option)
  File "/path/to/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1100, in notify_exception
    res = self.hook.pytest_internalerror(excrepr=excrepr, excinfo=excinfo)
  File "/path/to/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "/path/to/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/path/to/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
    return outcome.get_result()
  File "/path/to/venv/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/path/to/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "/path/to/venv/lib/python3.10/site-packages/_pytest/capture.py", line 888, in pytest_internalerror
    self.stop_global_capturing()
  File "/path/to/venv/lib/python3.10/site-packages/_pytest/capture.py", line 756, in stop_global_capturing
    self._global_capturing.stop_capturing()
  File "/path/to/venv/lib/python3.10/site-packages/_pytest/capture.py", line 673, in stop_capturing
    self.out.done()
  File "/path/to/venv/lib/python3.10/site-packages/_pytest/capture.py", line 509, in done
    os.close(self.targetfd_save)
  File "/path/to/venv/lib/python3.10/site-packages/pyfakefs/fake_os.py", line 1354, in wrapped
    return f(*args, **kwargs)
  File "/path/to/venv/lib/python3.10/site-packages/pyfakefs/fake_os.py", line 308, in close
    file_handle = self.filesystem.get_open_file(fd)
  File "/path/to/venv/lib/python3.10/site-packages/pyfakefs/fake_filesystem.py", line 857, in get_open_file
    self.raise_os_error(errno.EBADF, str(file_des))
  File "/path/to/venv/lib/python3.10/site-packages/pyfakefs/fake_filesystem.py", line 418, in raise_os_error
    raise OSError(err_no, message, filename)
OSError: [Errno 9] Bad file descriptor in the fake filesystem: '5'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/path/to/venv/lib/python3.10/site-packages/pyfakefs/fake_filesystem.py", line 1618, in get_object_from_normpath
    target = target.get_entry(component)  # type: ignore
  File "/path/to/venv/lib/python3.10/site-packages/pyfakefs/fake_file.py", line 542, in get_entry
    return self.entries[to_string(pathname_name)]
KeyError: 'Users'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/path/to/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 166, in main
    ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(
  File "/path/to/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "/path/to/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/path/to/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
    return outcome.get_result()
  File "/path/to/venv/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/path/to/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "/path/to/venv/lib/python3.10/site-packages/_pytest/main.py", line 316, in pytest_cmdline_main
    return wrap_session(config, _main)
  File "/path/to/venv/lib/python3.10/site-packages/_pytest/main.py", line 301, in wrap_session
    os.chdir(session.startpath)
  File "/path/to/venv/lib/python3.10/site-packages/pyfakefs/fake_os.py", line 1354, in wrapped
    return f(*args, **kwargs)
  File "/path/to/venv/lib/python3.10/site-packages/pyfakefs/fake_os.py", line 421, in chdir
    self.filesystem.confirmdir(path)
  File "/path/to/venv/lib/python3.10/site-packages/pyfakefs/fake_filesystem.py", line 2810, in confirmdir
    self.resolve(target_directory, check_owner=check_owner),
  File "/path/to/venv/lib/python3.10/site-packages/pyfakefs/fake_filesystem.py", line 1692, in resolve
    return self.get_object_from_normpath(
  File "/path/to/venv/lib/python3.10/site-packages/pyfakefs/fake_filesystem.py", line 1627, in get_object_from_normpath
    self.raise_os_error(errno.ENOENT, path)
  File "/path/to/venv/lib/python3.10/site-packages/pyfakefs/fake_filesystem.py", line 418, in raise_os_error
    raise OSError(err_no, message, filename)
FileNotFoundError: [Errno 2] No such file or directory in the fake filesystem: 'C:\\Users\\user\\code\\repo'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/path/to/venv/bin/pytest", line 8, in <module>
    sys.exit(console_main())
  File "/path/to/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 189, in console_main
    code = main()
  File "/path/to/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 174, in main
    config._ensure_unconfigure()
  File "/path/to/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1055, in _ensure_unconfigure
    fin()
  File "/path/to/venv/lib/python3.10/site-packages/_pytest/capture.py", line 756, in stop_global_capturing
    self._global_capturing.stop_capturing()
  File "/path/to/venv/lib/python3.10/site-packages/_pytest/capture.py", line 670, in stop_capturing
    raise ValueError("was already stopped")
ValueError: was already stopped

Hope that helps, please let me know if you need anything else! 👌
Just noticed this error: OSError: [Errno 9] Bad file descriptor in the fake filesystem: '5'

Thanks for the effort! I will have a closer look as soon as I find the time - probably at the end of this week.
This also sounds like some pytest-related problem, e.g. something in the pytest code got patched that shouldn't - I will see if there is an easy solution (like adding something to skipped modules).

I had another look, and it seems that this can indeed be prevented by excluding some pytest modules from patching. I'm not completely sure about possible side effects, but I think that these modues shall never be patched. You can test this by modifying your test like this:
import pyfakefs.fake_filesystem
from pyfakefs.fake_filesystem_unittest import Patcher
from _pytest import capture, pathlib

Patcher.SKIPMODULES.add(capture)
Patcher.SKIPMODULES.add(pathlib)

def test_foo(fs) -> None:
    fs.os = pyfakefs.fake_filesystem.OSType.WINDOWS

The additional skip modules would be added to the pytest plugin, but you can test it locally this way.
Please let me know if this fixes the problem for you!

That works, thank you! 🥳
Just to share, it seems like we can get away with skipping just pathlib:

Skipping neither: doesn't solve the issue
Skipping pathlib alone: solves the issue
Skipping pathlib and capture: solves the issue
Skipping capture alone: doesn't solve the issue

Thanks - I will skip only pathlib in this case! I already had problems with pytest pathlib in some other issue...
I'll make a PR in a moment.

authors: davidlbaird jamesbraza mrbean-bremen

repo: pytest-dev/pyfakefs

license_source: bigquery


text:
feature: columnar layout in Section

Is it possible to create columns in a document? I don't mean table columns, I mean columns within the body text, according to this documentation.
For example:

There is not yet API-level support for this in python-docx. Was that what you were asking?

Yes that's what I was wondering. Thanks! Should I leave this open for the future?

Yes, please

+1 for this feature

Is anyone working on this feature now or is there any show-stopper in development? I had an urgent need in this feature and it took less than 20 minutes to figure out a working solution so I'd share if it helps anyone. Is there anything fundamentally wrong with the solution below and if not - what would be the right way to integrate it (apart from the tests)?
For those needing this now here is a quick solution:
WNS_COLS_NUM = "{http://schemas.openxmlformats.org/wordprocessingml/2006/main}num"

def set_number_of_columns(section, cols):
    """ sets number of columns through xpath. """
    section._sectPr.xpath("./w:cols")[0].set(WNS_COLS_NUM, str(cols))

use example:
from docx import Document
from docx.enum.section import WD_ORIENT, WD_SECTION

doc = Document()
doc.add_paragraph("this page should be normal 1 column")
doc.add_page_break()
section = doc.add_section(WD_SECTION.NEW_PAGE)
set_number_of_columns(section, 2)
doc.add_paragraph("this page should have 2 columns and it seems to work ok")

Well, just offhand, I'd say you'd need to account for the case when w:cols is not already present, if it's an optional element, which, of course, most of them are. To determine that, you'd need to have the relevant parts of the XML schema, which is part of what goes on the enhancement proposal, aka. "analysis page".
Then the element name is more elegantly handled by the internal function qname(), like qname('w:num'). That function lives in docx.oxml I believe.
Also, of course, it would need to become a method on section, or more likely a set of properties or perhaps an object of its own, depending on the scope of things that can eventually be done to columns, like perhaps set their width, margin, or space between.
So you can see there would be a lot of additional details to attend to before it could be merged, and of course the tests. Best to start off with the enhancement proposal page if you want to pursue it. There would be specified the API and all the required background collected. All of this affects the implementation so best to get that discussed and merged before going more of the implementation than you'd like to redo :)

@scanny  is the two-column or even three-column feature implemented?

Is anyone working on this feature now or is there any show-stopper in development? I had an urgent need in this feature and it took less than 20 minutes to figure out a working solution so I'd share if it helps anyone. Is there anything fundamentally wrong with the solution below and if not - what would be the right way to integrate it (apart from the tests)?
For those needing this now here is a quick solution:
WNS_COLS_NUM = "{http://schemas.openxmlformats.org/wordprocessingml/2006/main}num"

def set_number_of_columns(section, cols):
    """ sets number of columns through xpath. """
    section._sectPr.xpath("./w:cols")[0].set(WNS_COLS_NUM, str(cols))

use example:
from docx import Document
from docx.enum.section import WD_SECTION

doc = Document()
doc.add_paragraph("this page should be normal 1 column")
doc.add_page_break()
section = doc.add_section(WD_SECTION.NEW_PAGE)
set_number_of_columns(section, 2)
doc.add_paragraph("this page should have 2 columns and it seems to work ok")

How awesome! Is there any solution to set width of each column, or set the width of line space area between two columns?

I have the same question! "Is there any solution to set width of each column, or set the width of line space area between two columns?"

It is possible to set width oh column with this code
...
WNS_COLS_WIDTH = "{http://schemas.openxmlformats.org/wordprocessingml/2006/main}space"
...
section._sectPr.xpath("./w:cols")[0].set(WNS_COLS_WIDTH, str(481))

where 481 is your desired width.

authors: Empty-Scott GaidamakUA electron378 gimbo jdhao leyiwang mike-charles mikecharles scanny

repo: python-openxml/python-docx

license: mit


text:
Review our bug reports form Sonar and triage or create issues as necessary

Describe the bug
Review our bug reports and triage as necessary
https://sonarcloud.io/dashboard?id=com.asanka.tutor%3Aonline-tutor

Related to #5 : Now that SonarQube is fully configured we will try to increase our ratings.


text:
ircbot: twitterbot can connect to more IRC networks

The bot now waits for the 001 welcome message before sending JOINs and
PRIVMSGs, allowing it to successfully connect to more IRC networks.

The bot is not really maintained anymore and I didn't think anyone would still use it, but this looks helpful and functional so let's merge it.
FYI, I've developped another bot based on this same lib here that might better fullfill your needs: https://github.com/rouxrc/gazouilleur

authors: boogheta hiddn

repo: python-twitter-tools/twitter


text:
🛑 Billing Api is down

In 0b90676, Billing Api (https://billing.roblox.com/) was down:

HTTP code: 404
Response time: 85 ms

Resolved: Billing Api is back up in 3aa9840 after 1 hour, 16 minutes.

repo: pythoniaweb/roblox-status


text:
AttributeError: module 'torchaudio._internal.module_utils' has no attribute 'requires_sox'

🐛 Describe the bug
I am trying to import torchaudio.
The bug "AttributeError: module 'torchaudio._internal.module_utils' has no attribute 'requires_sox'" occurs
My code
import torch
import torchaudio

matplotlib.rcParams["figure.figsize"] = [16.0, 4.8]

torch.random.manual_seed(0)
device = "cuda" if torch.cuda.is_available() else "cpu"

print(torch.__version__)
print(torchaudio.__version__)
print(device)

Traceback
AttributeError                            Traceback (most recent call last)
/tmp/ipykernel_129825/1558347532.py in <module>
      1 import torch
----> 2 import torchaudio
      3
      4 matplotlib.rcParams["figure.figsize"] = [16.0, 4.8]
      5

~/anaconda3/envs/comp3340/lib/python3.7/site-packages/torchaudio/__init__.py in <module>
      1 from . import extension
      2 from torchaudio._internal import module_utils as _mod_utils
----> 3 from torchaudio import (
      4     compliance,
      5     datasets,

~/anaconda3/envs/comp3340/lib/python3.7/site-packages/torchaudio/transforms/__init__.py in <module>
----> 1 from ._multi_channel import MVDR, PSD, RTFMVDR, SoudenMVDR
      2 from ._transforms import (
      3     AmplitudeToDB,
      4     ComputeDeltas,
      5     Fade,

~/anaconda3/envs/comp3340/lib/python3.7/site-packages/torchaudio/transforms/_multi_channel.py in <module>
      6 import torch
      7 from torch import Tensor
----> 8 from torchaudio import functional as F
      9
     10

~/anaconda3/envs/comp3340/lib/python3.7/site-packages/torchaudio/functional/__init__.py in <module>
     23     vad,
     24 )
---> 25 from .functional import (
     26     amplitude_to_DB,
     27     apply_beamforming,

~/anaconda3/envs/comp3340/lib/python3.7/site-packages/torchaudio/functional/functional.py in <module>
   1266
   1267
-> 1268 @_mod_utils.requires_sox()
   1269 def apply_codec(
   1270     waveform: Tensor,

I have use it in my another code, but same result
The method I have tried:
1.Reinstall pytorch
2. Update torchaudio
But it doesn't work
Versions
Collecting environment information...
PyTorch version: 1.7.1
Is debug build: False
CUDA used to build PyTorch: 10.1
ROCM used to build PyTorch: N/A
OS: Ubuntu 22.04.1 LTS (x86_64)
GCC version: (Ubuntu 11.2.0-19ubuntu1) 11.2.0
Clang version: Could not collect
CMake version: Could not collect
Libc version: glibc-2.10
Python version: 3.7.7 (default, Mar 26 2020, 15:48:22)  [GCC 7.3.0] (64-bit runtime)
Python platform: Linux-5.15.0-50-generic-x86_64-with-debian-bookworm-sid
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True
Versions of relevant libraries:
[pip3] numpy==1.19.2
[pip3] pytorch-lightning==1.3.6
[pip3] pytorch-tabnet==3.0.0
[pip3] torch==1.13.0
[pip3] torchaudio==0.13.0
[pip3] torchmetrics==0.5.0
[pip3] torchvision==0.8.2
[pip3] transformer-pytorch==0.0.1
[conda] _pytorch_select           0.1                       cpu_0    anaconda
[conda] blas                      1.0                         mkl
[conda] cudatoolkit               10.1.243             h6bb024c_0    anaconda
[conda] libmklml                  2019.0.5             h06a4308_0    anaconda
[conda] mkl                       2020.2                      256    anaconda
[conda] mkl-service               2.3.0            py37he8ac12f_0
[conda] mkl_fft                   1.0.6            py37h7dd41cf_0    anaconda
[conda] mkl_random                1.1.1            py37h0573a6f_0    anaconda
[conda] numpy                     1.19.2           py37h54aff64_0
[conda] numpy-base                1.19.2           py37hfa32c7d_0
[conda] pytorch                   1.7.1           py3.7_cuda10.1.243_cudnn7.6.3_0    pytorch
[conda] pytorch-lightning         1.3.6                    pypi_0    pypi
[conda] pytorch-tabnet            3.0.0                    pypi_0    pypi
[conda] torch                     1.13.0                   pypi_0    pypi
[conda] torchaudio                0.13.0                   pypi_0    pypi
[conda] torchmetrics              0.5.0                    pypi_0    pypi
[conda] torchvision               0.4.0                    pypi_0    pypi
[conda] transformer-pytorch       0.0.1                    pypi_0    pypi

Hi @Justinfungi, what does print(torch.__version__) print out? Seems the environment has both pytorch 1.7.1 and torch 1.13.0 installed, along with torchaudio 0.13.0.
On my end, I don't seem to be able to reproduce this error. Could you try reinstalling torch and torchaudio on a fresh environment and trying again? Either conda install pytorch torchaudio -c pytorch or pip install torch torchaudio should work.

This happens in notebooks when users update torchaudio and attempt to re-import it without restarting the notebook kernel.
https://github.com/pytorch/audio/issues/1632

authors: Justinfungi carolineechen mthrok

repo: pytorch/audio


text:
phase_advance should be a buffer so it moves device correctly

@vincentqb, fixing what was mentioned https://github.com/pytorch/audio/pull/456.

Can you show an error that would occur without that change? Some attributes/etc are inferred by nn.Module, see here. If this is indeed needed here, it may be needed elsewhere in the transforms.

Yeah so here's an example:
import torch
from torchaudio.transforms import TimeStretch
m = TimeStretch().cuda()
m(torch.randn(1, 2, 201, 400, 2).cuda(), 1.3)

Will give a RuntimeError: expected device cuda:0 but got device cpu. Also we're using buffers on the other transforms as far as I'm aware, see here for example.

authors: ksanjeevan vincentqb


text:
Why does the feature vector increase the dimensionality?

❓ Questions and Help
Before asking:

search the issues.
search the docs.

What is your question?
When running the wav2vec_featurize.py on a raw audio file, I find that I have 93680 length for an audio file, but that results in a feature vector with a shape of (512, 583). That means I have 298496 data points now, whereas the raw audio only has 93680. I thought the point of embeddings was to reduce dimensionality, so I'm a bit confused as to why it's expanded?
Code
python examples/wav2vec/wav2vec_featurize.py --input data-bin/LibriSpeech --output tmp --model data-bin/models/wav2vec_large.pt --split dev-clean --ext flac --no-copy-labels --use-feat

What have you tried?
What's your environment?

fairseq Version (e.g., 1.0 or master): master
PyTorch Version (e.g., 1.0)
OS (e.g., Linux):
How you installed fairseq (pip, source):
Build command you used (if compiling from source):
Python version:
CUDA/cuDNN version:
GPU models and configuration:
Any other relevant information:

the raw waveform is encoded into representations with strides of 10ms. librispeech has sample rate of 16khz so 93680/160 = 585.5. you lose a bit because of "valid" padding (as opposed to "same") but seems to add up...

authors: alexeib shamoons

repo: pytorch/fairseq


text:
Implementation of a full multilingual RNN encoder-decoder (gru/lstm) with Bahdanau and Luong attentions

🚀 Feature Request
I would like to introduce the implementation of a multilingual recurrent encoder decoder, usable with either GRU or LSTM, and  all of the attentions in Luong's paper (dot, general, concat), the original Bahdanau attention, and Bahdanau's attention modified to use the mechanisms of Luong's papers.
Motivation
I am working on low resource translation and computational historical linguistics, two topics which

have very little data =>  the transformer is way too big to use (I can provide a bibliography for this if needed)
need attentive models => the reference models for my task are the RNN enc-dec with attention
need multilinguality (especially in historical linguistics)

Pitch
I re-coded a multilingual recurrent encoder decoder with attentions in PyTorch, following the original equations of Luong and Bahdanau's papers, added the multilinguality (inspired by the multilingual transformer), and would like to integrate it to fairseq now.
Alternatives

A multilingual transformer does not work bc too big for the small datasets we use.
Your current implementation of the LSTM is not parametrizable enough for the needs of the task (the different types of attention available in Luong and Bahdanau papers provide different insights on the data)
Launching the model in --user-dir mode, but then other people would not be able to benefit from this implementation 🙂

Additional context
If you are interested, I provided my implementation in https://github.com/pytorch/fairseq/pull/3034 (sorry for doing things in the wrong order).

This code is used in the ACL 2021 Findings paper "Can Cognate Prediction Be Modelled as a Low-Resource Machine Translation Task?"


text:
Use lintrunner

🐛 Describe the bug
It isn't obvious how to run lints locally. lintrunner, used by pytorch main repo, makes this very easy.
Versions
master

The instructions regarding linting are here: https://github.com/pytorch/vision/blob/main/CONTRIBUTING.md#code-formatting-and-typing. Let us know if they're not clear enough.
As far as I know, our process predates (by a lot) the existence of linterunner and its adoption by torch core. We're using tools and processes that are closer to what other major repos are using, and it's been working fine for us.

I think my big problem was https://github.com/pytorch/vision/pull/7462

I also want to point out that your CONTRIBUTING docs don't include pydocstyle, which I just tripped over in my PR. lintrunner makes it easy to make sure you ran ALL of the lints, not just each one individually.
Anyway, you don't have to do it, I mostly want permission to do the switch if someone decides they want to do it.

authors: NicolasHug ezyang

repo: pytorch/vision


text:
Add support for other normalizations in MobileNetV2 (#2267)

Add norm_layer to MobileNetV2

Add simple test case

Small fix

Merged in de9a2c1


text:
vertex coloring

I have object files that don't support per vertex coloring.Also I have .mtl files.Is it possible to get per vertex colors

You have an obj file without vertex color and you want to add colors programmatically?

Thank you for response.
Example of .obj  file
mtllib 0000.mtl
v 0.354434 6.578578 -53.255806
v 0.372568 5.231034 -53.458153
.....
vt 0.483132 0.512387
vt 0.483085 0.508470
......
vn 0.367322 0.882667 0.293212
vn 0.236551 0.442998 0.864752
.....
g 0000
usemtl 0000
f 1/1/1 2/2/2 3/3/3
f 3/3/3 4/4/4 1/1/1
....
Example of .mtl file
newmtl 0000
Ka  0.15858 0.160808 0.113047
Kd  0.792901 0.804041 0.565233
Ks  0.47 0.47 0.47
d 1
Ns 0
illum 2
map_Kd 0000.jpg
Also I get vertices  (v in my .obj) with mesh.vertices, what is the way of getting uv vertices (vt in my .obj)?

I recently made an example here: https://github.com/pywavefront/PyWavefront/issues/87#issuecomment-464348971
The project definitely need more docs about this currently. I'm trying to resolve that soon.

Thanks a lot. I am closing this issue

authors: einarf victoriapoghosyan

repo: pywavefront/PyWavefront


text:
not every Docker image uses requirement.txt in ibm_cf

Some Docker images in ibm_cf doesn't use requirements.cf, for example Dockerfile.python36
Should all images we consistent?

@JosepSampe what is your input on this?

Those I created yes (Dockerfile.python38 and Dockerfile.slim), the other ones, I don't know. I never used them.
This one you refer (Dockerfile.python36) can be deleted, it is the same as the Dockerfile. The only difference is the build time. With Dockerfile you have to install everything, and with Dockerfile.python36 everything is installed from ibmfunctions/action-python-v3.6, however it might contain different python packages versions.

@JosepSampe which one we need there? I actually using Dockerfile.python36 all the time :)

If you were using Dockerfile.python36, you can use: https://github.com/pywren/pywren-ibm-cloud/blob/master/runtime/ibm_cf/Dockerfile

authors: JosepSampe gilv

repo: pywren/pywren-ibm-cloud


text:
🛑 notabird.site is down

In da6a366, notabird.site (https://notabird.site) was down:

HTTP code: 520
Response time: 59 ms

Resolved: notabird.site is back up in ebf957f.


text:
🛑 nitter.projectsegfau.lt is down

In 7c1573b, nitter.projectsegfau.lt (https://nitter.projectsegfau.lt) was down:

HTTP code: 503
Response time: 769 ms

Resolved: nitter.projectsegfau.lt is back up in 8aaa59a after 11 minutes.


text:
🛑 nitter.tiekoetter.com is down

In 4ba7e7b, nitter.tiekoetter.com (https://nitter.tiekoetter.com) was down:

HTTP code: 502
Response time: 954 ms

Resolved: nitter.tiekoetter.com is back up in 10efa78 after 39 minutes.


text:
🛑 nitter.tiekoetter.com is down

In fdb1db7, nitter.tiekoetter.com (https://nitter.tiekoetter.com) was down:

HTTP code: 502
Response time: 536 ms

Resolved: nitter.tiekoetter.com is back up in a4ed3dc after 5 minutes.


text:
🛑 notabird.site is down

In 1392f1a, notabird.site (https://notabird.site) was down:

HTTP code: 520
Response time: 108 ms

Resolved: notabird.site is back up in ccf713d after 26 minutes.


text:
Reduce amount of memory required by mining strategies

E.g. in semi-hard mining we use cubic matrix and it consumes lots of memory.
https://github.com/qdrant/quaterion/blob/f2be2a4a7ba00f4484090222838898ce73e7d682/quaterion/loss/triplet_loss.py#L157
Due to this usage of memory train_cifar100_with_xbm.py crashes even on 3090Ti with "GPU out of memory" (after it exceeds start_iteration and starts computing xbm loss)

This is a known issue marked as TODO. Currently it allows to use XBM with smaller batches. We postponed it to be handled later on --you can assign it to me if you aren't working on it already.

Completed in #186

authors: joein monatis

repo: qdrant/quaterion


text:
ImportError on MSDA

I have an error when i tried to run
GPUS_PER_NODE=8 ./tools/run_dist_launch.sh $1 swinb $2 configs/swinb_train_single.sh
it says :
Traceback (most recent call last):   File "test.py", line 18, in <module>     from functions.ms_deform_attn_func import MSDeformAttnFunction, ms_deform_attn_core_pytorch   File "/home/fisalaly/TransVOD_Lite/models/ops/functions/__init__.py", line 9, in <module>     from .ms_deform_attn_func import MSDeformAttnFunction   File "/home/fisalaly/TransVOD_Lite/models/ops/functions/ms_deform_attn_func.py", line 18, in <module>     import MultiScaleDeformableAttention as MSDA ImportError: /home/fisalaly/TransVOD_Lite/models/ops/MultiScaleDeformableAttention.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZN6caffe28TypeMeta21_typeMetaDataInstanceISt7complexIdEEEPKNS_6detail12TypeMetaDataEv
what i have done :

I tried to reinstall mmcv-full (i found some solutions on Stackoverflow) but the error still exist
i tried to re-build MultiScaleDeformableAttention wtih sh ./make.sh , it says MultiScaleDeformableAttention 1.0 is already the active version in easy-install.pth . But when i tried to run test.py . the error showed up again

can anyone help me with this issue?

Hi, sorry for the late reply.
The reason for this error is that you did not successfully install MultiScaleDeformableAttention, which has nothing to do with the installation of MMCV.
First, please check your installing environment and follow the instruction for the installation of MultiScaleDeformableAttention in Deformable DETR.
Then, I suggest that you need first uninstall MultiScaleDeformableAttention, including removing the files and reinstalling them again. If you don't rm -rf those files, the error could show up again.
Hope this could be helpful to you.
Thanks,

authors: fisal-ITS qianyuzqy


text:
给个docker吧，明天参加深圳的cpp会议用

RT

https://github.com/Maxwell1987/feather-toolkit
在这里

抱歉现在才看到，有任何问题随时提出吧。

authors: Maxwell1987 ppLorins qicosmos

repo: qicosmos/feather


text:
功能建议：希望制作安卓版本

如图，目前移动设备听歌比较麻烦(自制平板电脑，官方应用不兼容X86设备，lxmusic不支持登录账户)，需要一个移动版的yesplaymusic

支持

估计不会上了，已经维护阶段了

authors: SteveWorkshop leptobo longge0225


text:
Mac

操作系统OS
Mac
应用版本
1.3.5
问题描述
Mac上用alfred无法用Redis搜索定位App
手动把app名里的.号改成空格就可以了

估计是把Another.Redis.Desktop.Manager当成一个单词了，没有切分
后面预感可能会改名字，改成个短的，再使用Alfred就没问题了

v1.3.6 productName已经改为空格分隔，不过该版本升级后可能会出现老版本还存在的情况，此时删除老版本即可

v1.3.6 productName已经改为空格分隔，不过该版本升级后可能会出现老版本还存在的情况，此时删除老版本即可

谢谢~

authors: ojeo qishibo

repo: qishibo/AnotherRedisDesktopManager


text:
Update circle.yml to 2.0

Fixes #[issue number].
Status
[ X ] Under development

Information
[ X ] Rewrite of circle.yml file, due to 1.0 will be obsolete in august.

To-do list
[ X ] Make it stable

Hi, and thanks for contributing!
Before we can handle your pull request we need you to sign our contributor license agreement.
This is a one-time thing and enables you to contribute without hassle to any of the qlik-oss repositories in the future.
And it only takes a few minutes! Here are some useful links to get you started:

Sign the CLA
Rationale behind the CLA
Qlik R&D Open Source repository
Official Slack team

Having troubles? Feel free to reach out to us either here or on Slack!

authors: pontusnyman qlikossbuild

repo: qlik-oss/leonardo-ui


text:
fix(to-dts): use double quatation marks for literals

Strip ' from literals to ensure it becomes type: 'axis' (instead of type: "'axis'").

A unit test validating this would be nice.

A unit test validating this would be nice.

I have added a unit test to verify the functionality.

authors: streamside veinfors

repo: qlik-oss/scriptappy


text:
Test Issue - rdtkw

Test Body - qaxdsxsafy

Test Comment - mhpvw

repo: qlikqaa/dummyrepo


text:
Test Issue - obywv

Test Body - cpmooegtuh

Test Comment - rsmzo


text:
Test Issue - zkmad

Test Body - asrsapngtv

Test Comment - himet


text:
Test Issue - qbquf

Test Body - udqnhkktgo

Test Comment - glvoa


text:
Test Issue - ssjgx

Test Body - jnczhrcolf

Test Comment - zclrx


text:
Test Issue - zcwmd

Test Body - zsehutscxl

Test Comment - imdeo


text:
Test Issue - veqrp

Test Body - socuxyrytg

Test Comment - vwaja


text:
Test Issue - qxrvf

Test Body - hgkogpyeas

Test Comment - sizmy


text:
Test Issue - bcqgb

Test Body - vhoertzgfh

Test Comment - yeait


text:
Test Issue - eikxp

Test Body - cesgxaiweb

Test Comment - oeprx


text:
Test Issue - vowax

Test Body - zzrbbuawjl

Test Comment - auymm


text:
Test Issue - kxfcu

Test Body - cxktztrwvb

Test Comment - vgrnh


text:
Test Issue - vkdhj

Test Body - tqcvikorld

Test Comment - yneet


text:
Test Issue - axmev

Test Body - bqbkgyyunk

Test Comment - tojfa


text:
Test Issue - kttwd

Test Body - gikwkxvslh

Test Comment - qsqyt


text:
Test Issue - zjwks

Test Body - frrtjeksub

Test Comment - deqte


text:
Test Issue - hrmcv

Test Body - afvzvtyqws

Test Comment - idjjq


text:
Test Issue - hmqic

Test Body - zcaihqbknb

Test Comment - gilmp


text:
Test Issue - yvzgo

Test Body - vqjfumtvlr

Test Comment - jeflb


text:
Test Issue - oyddp

Test Body - jepogpwzyl

Test Comment - brjen


text:
Test Issue - ontcv

Test Body - hfadykvyfa

Test Comment - yvufl


text:
unable to update to latest version of Selenium when running firefox

QAF Version

Note: only the latest version is supported
I have tried 2.1.11, 2.1.12, 2.1.12-RC2 and 2.1.12-RC3
I was running successfully with version 3.0.0 but when trying to update to resolve an issue with firefox webdriver, I ran into this problem with QAF. I have looked at several closed issues in this repo.. #118 , #60 , #88 but was unable to find resolution.

Steps To Reproduce
1. update to latest version of selenium 3.5.3

POM included below:

org.seleniumhq.selenium
selenium-java
3.5.3

org.seleniumhq.selenium
selenium-remote-driver
3.5.3

org.seleniumhq.selenium
selenium-support
3.0.0

com.qmetry
qaf

2.1.12-RC3

com.qmetry
qaf-support
${qaf.version}

com.sun.jersey.contribs
jersey-multipart
1.19.4

com.qmetry
qaf-qtm4j-updator
2.1.13-RC1

com.jayway.restassured
rest-assured
2.9.0

com.jayway.jsonpath
json-path
2.2.0

com.jayway.restassured
json-schema-validator
2.2.0

</dependencies>

Expected behavior
Tests run in firefox as they did with previous versions of Selenium
Actual behavior
Running TestSuite
log4j:WARN No such property [follow] in org.apache.log4j.FileAppender.
[ConfigurationManager] - ISFW build info: {qaf-Type=core, qaf-Revision=12-RC3, qaf-Version=2.1, qaf-Build-Time=06-Aug-2017 11:49:43}
[ConfigurationManager] - Resource dir: /Users/swinters/IdeaProjects/AutomationTesting/resources. Found property files to load: 14
[ConfigurationManager] - Resource dir: /Users/swinters/IdeaProjects/AutomationTesting/resources. Found property files to load: 0
[QAFTestBase] - Initializing Driver...browser_str:remotefirefoxDriver,base_url:http://test.gcihub.com,sel_server:10.171.3.184,port:4444
[UiDriverFactory] - Driver: remotefirefoxDriver
[QAFTestBase] - Initializing Driver...browser_str:remotefirefoxDriver,base_url:http://test.gcihub.com,sel_server:10.171.3.184,port:4444
[QAFTestBase] - Initializing Driver...browser_str:remotefirefoxDriver,base_url:http://test.gcihub.com,sel_server:10.171.3.184,port:4444
[UiDriverFactory] - Driver: remotefirefoxDriver
[UiDriverFactory] - Driver: remotefirefoxDriver
Unable to create driver instance in 1st attempt with retry timeout of 0 seconds. You can check/set value of 'driver.init.retry.timeout' appropriately to set retry timeout on driver initialization failure.Unable to Create Driver Instance Error forwarding the new session webdriver new session JSON response body did not contain a session ID
Command duration or timeout: 3.93 seconds
[QAFTestBase] - Initializing Driver...browser_str:remotefirefoxDriver,base_url:http://test.gcihub.com,sel_server:10.171.3.184,port:4444
[UiDriverFactory] - Driver: remotefirefoxDriver
Unable to create driver instance in 1st attempt with retry timeout of 0 seconds. You can check/set value of 'driver.init.retry.timeout' appropriately to set retry timeout on driver initialization failure.Unable to Create Driver Instance Error forwarding the new session webdriver new session JSON response body did not contain a session ID
Command duration or timeout: 4.07 seconds
Unable to create driver instance in 1st attempt with retry timeout of 0 seconds. You can check/set value of 'driver.init.retry.timeout' appropriately to set retry timeout on driver initialization failure.Unable to Create Driver Instance Error forwarding the new session webdriver new session JSON response body did not contain a session ID
Command duration or timeout: 4.25 seconds
Unable to create driver instance in 1st attempt with retry timeout of 0 seconds. You can check/set value of 'driver.init.retry.timeout' appropriately to set retry timeout on driver initialization failure.Unable to Create Driver Instance Error forwarding the new session webdriver new session JSON response body did not contain a session ID
Command duration or timeout: 3.92 seconds
[QTM4JResultUploader] - QTM4J Integration is not enabled. To enable it set integration.param.qtm4j.enabled=true
Tests run: 4, Failures: 0, Errors: 0, Skipped: 4, Time elapsed: 8.889 sec
Preparing For Shut Down...
Preparing For Shut Down...
Preparing For Shut Down...
Is the issue reproductible on runner?

[x] QAS
[ ] Maven
[ ] Gradle
[x] Ant
[ ] Eclipse

Test case sample

Please, share the test case (as small as possible) which shows the issue

I am seeing the following error when I use selenium-java v 3.53.3 and selenium-support v 3.53.3
org.openqa.selenium.support.ui.FluentWait.withMessage(Lcom/google/common/base/Supplier;)Lorg/openqa/selenium/support/ui/FluentWait;

You need to use selenium-support v 3.0.0
It looks like you are using grid to run your test. If so did you provided webdriver.gecko.driver while starting up grid? You can test in your local environment by using driver.name=firefoxDriver and setting system property system.webdriver.gecko.driver=<geckodriverpath>
This issue doesn't seems QAF compatibility webdriver issue.

yes, I have set the system property for webdriver.gecko.driver on all of my grid nodes. this was working with version 3.0.0 of Selenium, but when I switch to version 3.53.3 it stops working.

Try without grid (as well as different driver) to find where the exact problem. This doesn't looks like QAF issue. Will you please post it in qaf user group?
May be you can refer any of the following and other issues with same error:

7421 - Firefox WebDriver init problem - Error forwarding new session JSON response body did not contain a session ID
4185 - Error forwarding the new session...
WebDriver grid configuration throws error

This issue can be closed. You are correct, it was not a QAF issue. my version of the Selenium Grid Hub was incorrect. I am using Docker and it was an old image.

repo: qmetry/qaf


text:
Added a page for "Vitamins Included" revision 2

Hi there. We are currently looking at getting a run of the second revision of Vitamins Included made, and I was thinking of different ways/places to document the board, and it occurred to me that qmk.fm was probably a logical place to put it, as it has all the relevant links to general QMK documentation.
The boards don't exist yet, but quotes have been gathered and suppliers have been contacted. I'm perfectly fine with leaving this PR up until the board actually exists if you'd prefer that :)

I squashed the commits


text:
Game UI is messed up

As you probably can see in the picture, I can't get the game to run properly. The menu UI can be seen, as well as a screenshot of how the game itself looks.

looks like you got outdated ddraw.dll

repo: qndel/Infernity

license: Unlicense


text:
Add --check mode for CI

Here is a proposal in order to run the script as a simple file format checker, which would exit on the first file with incorrect formatting (useful for CI).
I actually have no idea how to do that properly, but this seems to work on my end.
I've rebased this PR on this other PR https://github.com/qnp/lus/pull/1 for practical reasons, I will adjust depending of the outcome of that other PR.
cheers

Thanks for the proposal, it looks a good idea. I:

merged master since your previous PR was merged
reworked the logic
made some options optional
removed a NodeJS deprecation warning
added the corresponding test case ✅

can you give it a quick look ?
best

That's awesome 👍
just some nitpicking, I didn't throw a new Error when a non formatted file is found because the error stack is noisy and useless for this case, I assumed the user just wants to quickly spot the incriminated files in the logs. Other than that it works fine, thank you very much for taking the time to do this properly 🙏

Hi @adrienWeiss,
Regarding throwing a string, it is not considered as a good practice. Quoting MDN for instance:

In practice, the exception you throw should always be an Error object or an instance of an Error subclass, such as RangeError. This is because code that catches the error may expect certain properties, such as message, to be present on the caught value. For example, web APIs typically throw DOMException instances, which inherit from Error.prototype.

If the stacktrace is too verbise, I would rather suggest that where you handle the error, you only print what is relevant for you (e.g. error.message in your case).
Can I let you do the desired updates in the PR accordingly ?
Best regards

you're right I'll make the change ASAP & update the PR one last time 👍

Hi @adrienWeiss, sorry for the late followup. I've merged the PR and release 0.4.0.
best regards

thank you @qnp and no worries, we've been using our own patch-package in the meantime and I even forgot about this PR
I'll update soon
cheers 👋

authors: adrienWeiss qnp

repo: qnp/lus


text:
Set initialize module buttons to warning button style with refresh icon

Came across an initialize button that wasn't getting styled, small update to style it with the refresh icon and warning style.

Thanks, I'll take a look closer to the next release.

Hi, Michael.
I'm not sure where it is but it seem to case no issue. Trusting you on that. ;)
It will be added in 18.30.

authors: mvarian qooob

repo: qooob/authentic-theme


text:
Oracle JDK builds include proprietary javadoc

Hey Ceki and qos folk,
Looking at the Javadoc jar from https://central.sonatype.com/artifact/org.slf4j/slf4j-ext/2.1.0-alpha1 it contains:
slf4j-ext-2.1.0-alpha1-javadoc/legal/LICENSE

This is an Oracle "No-Fee Terms and Conditions license agreement".
I'm not sure if this was your intent, or if this has snuck in due to Oracle JDK being used to perform the release. Sharing in case it's a concern for you.

@hyandell Thank you for catching this.

How did it get there and how do I get rid of it in future releases?

My theory has been that it comes from releasing with the Oracle JDK rather than OpenJDK. OpenJDK inserts GPL JavaScript for this search feature, which is less of a "Whaaatttt???" flag than the proprietary Oracle text. At least for my over-Apache influenced eyes :)
Though I saw you commented on the Fury issue that you get the proprietary licensing even when using OpenJDK?

@hyandell

Though I saw you commented on the Fury issue that you get the proprietary licensing even when using OpenJDK?

Yes. I think so. In any case, the contents of legal/LICENSE generated by OpenJDK javadocs also seemed strange but I have not read the contents of the license with any attention.
Eclipse Temurin also generates a legal/LICENSE file which contains the string "../base.legal" which may be more acceptable.

My recollection is that OpenJDK's 'strangeness' in the javadoc will be GPL-2.0, I believe with ClasspathException. And Temurin is presumably pointing to an Eclipse license (BSD? Eclipse-2.0? I haven't looked).
It's very frustrating that N different approaches are all sneaking licensing into the built artifacts. I feel we all reasonably expect that the Java build tools add no licensing beyond what the input provides.
I think they are largely a nuisance, I've long since adapted to not worry about the GPL showing in javadoc jars for the search functionality. For example, not something that worries me over at Apache with a licensing committee hat on. And I think most open source projects are using OpenJDK.
But the Oracle's JDK more proprietary licensing feels out of sorts with an open source project; it's weird enough noise for users that I feel it causes more confusion/doubt than simply seeing an Eclipse or GPL license.

authors: ceki hyandell