profile
viewpoint
Georg Brandl birkenfeld FZ Jülich München

alecthomas/importmagic 96

A Python library for finding unresolved symbols in Python code, and the corresponding imports

birkenfeld/advent18 22

Advent of Code 2018 (Rust)

birkenfeld/advent19 2

Advent of Code 2019

birkenfeld/.dotfiles 0

dotfiles repo

birkenfeld/.emacs.d 0

Emacs configuration

birkenfeld/advent15 0

Advent of Code 2015

birkenfeld/advent16 0

Advent of Code 2016

birkenfeld/advent17 0

Advent of Code 2017

pull request commentstm32-rs/stm32-eth

Add reproducer example for #10

Indeed, on Wireshark I see (at the end of the stalling period) an ARP request that is sent and replied to.

birkenfeld

comment created time in 2 hours

pull request commentstm32-rs/stm32-eth

Add reproducer example for #10

OK, now I see this:

[58.063125] got: 480033 packets => 100.0 MBit/s
[58.563712] got: 484172 packets => 100.0 MBit/s
[59.064301] got: 484370 packets => 99.2 MBit/s
[59.564872] got: 484370 packets => 98.4 MBit/s
[60.065456] got: 484370 packets => 97.5 MBit/s
[60.566040] got: 484370 packets => 96.7 MBit/s
[61.066616] got: 484370 packets => 95.9 MBit/s
[61.567167] got: 484793 packets => 95.2 MBit/s
[62.067735] got: 488932 packets => 95.3 MBit/s

So it's stalling for a few seconds, and then proceeding to send. I assume this means the ARP still isn't sent, and this is the timeout you added for waiting on the reply?

birkenfeld

comment created time in 2 hours

Pull request review commentPyO3/pyo3

Py::as_ref and Py::into_ref (remove AsPyRef)

 where         let ob = unsafe { Py::from_owned_ptr(py, obj as _) };         Ok(ob)     }+}++impl<T> Py<T>+where+    T: PyTypeInfo,+{+    /// Borrows a GIL-bound reference to the contained `T`. By binding to the GIL lifetime, this+    /// allows the GIL-bound reference to not require `Python` for any of its methods.+    ///+    /// For native types, this reference is `&T`. For pyclasses, this is `&PyCell<T>`.+    ///+    /// # Examples+    /// Get access to `&PyList` from `Py<PyList>`:+    ///+    /// ```+    /// # use pyo3::prelude::*;+    /// # use pyo3::types::PyList;+    /// # Python::with_gil(|py| {+    /// let list: Py<PyList> = PyList::empty(py).into();+    /// let list: &PyList = list.as_ref(py);+    /// assert_eq!(list.len(), 0);+    /// # });+    /// ```+    ///+    /// Get access to `&PyCell<MyClass>` from `Py<MyClass>`:+    ///+    /// ```+    /// # use pyo3::prelude::*;+    /// #[pyclass]+    /// struct MyClass { }+    /// # Python::with_gil(|py| {+    /// let my_class: Py<MyClass> = Py::new(py, MyClass { }).unwrap();+    /// let my_class_cell: &PyCell<MyClass> = my_class.as_ref(py);+    /// assert!(my_class_cell.try_borrow().is_ok());+    /// # });+    /// ```+    pub fn as_ref<'py>(&'py self, _py: Python<'py>) -> &'py T::AsRefTarget {+        let any = self.as_ptr() as *const PyAny;+        unsafe { PyNativeType::unchecked_downcast(&*any) }+    }++    /// Similar to [`as_ref`](#method.as_ref), and also consumes this `Py` and registers the+    /// Python object reference in PyO3's object storage. The reference count for the Python+    /// object will not be decreased until the GIL lifetime ends.+    ///+    /// # Example+    ///+    /// Useful when returning GIL-bound references from functions:+    /// ```+    /// # use pyo3::prelude::*;+    /// fn new_py_any(py: Python, value: impl IntoPy<PyObject>) -> &PyAny {

One last suggestion: add an explicit lifetime to Python and &PyAny?

davidhewitt

comment created time in 3 hours

delete branch birkenfeld/pyo3

delete branch : guide-exc

delete time in 3 hours

pull request commentPyO3/pyo3

guide: show exporting create_exception! exceptions in a module

This worked when I tried it:

try:
    rustmod.func()
except rustmod.CustomError:
    ...

where rustmod.func() raises the exception.

birkenfeld

comment created time in 3 hours

PR opened stm32-rs/stm32f4xx-hal

serial: remind users to NVIC::unmask interrupts

In ref to #198

This is a copy of the hint for the Timer.

+3 -0

0 comment

1 changed file

pr created time in 14 hours

push eventbirkenfeld/stm32f4xx-hal

Daniel Egger

commit sha 75ee78371ef8c610aa649e90d5063481f7fd382c

Merge pull request #31 from birkenfeld/master Update stm32f4 dependency to 0.4

view details

Patrick Seidel

commit sha ea8c5d233ed3310dfa751ce67514ee7cb79fb02e

SPI: Add SPI4/5/6 support

view details

Daniel Egger

commit sha 0b83f5baec16d9894ca84d7e0da109120d40d7c3

Merge pull request #32 from psycowithespn/f4_spi SPI: Add SPI4/5/6 support

view details

Daniel Egger

commit sha bd341eb15dd517ac18bf423da73814c541550c01

Bumped crate version to 0.2.5 Signed-off-by: Daniel Egger <daniel@eggers-club.de>

view details

Patrick Seidel

commit sha dbad6dae5e32150f405c006faddd1cd29d5f2175

I2C: Use correct peripheral clock, use consistent units, fix standard speed CCR setting, fixes #26

view details

Daniel Egger

commit sha 0bde634d2539ba999a22ae65eec3dcc2cd43a17d

Merge pull request #34 from psycowithespn/i2c_speed_fix Fix I2C speed issues

view details

Aurelien Jacobs

commit sha 78326c05a01189d7701acce4d613d2c2adb4e2ef

rcc: all stm32f4 have a min sysclk of 24 MHz except the stm32f446

view details

Daniel Egger

commit sha 2ad040451535f559f6e297085617ff658d321433

Merge pull request #35 from aurelj/rcc rcc: stm32f411 min sysclk is 12.5 MHz like most stm32f4

view details

Aurelien Jacobs

commit sha 3b21be5e552860d08348c8d17a3856281befb14b

gpio: add GPIOH PH0 and PH1 for stm32f401

view details

Daniel Egger

commit sha a8ddb172d6fa169031447f12b0c5b3c9646334b3

Merge pull request #38 from aurelj/gpio401 gpio: add GPIOH PH0 and PH1 for stm32f401

view details

Patrick Seidel

commit sha 697a344755493bafa41e6e96ea758ed8ae06bac8

OTy is 1 for open drain, not 0

view details

Daniel Egger

commit sha 1c10336a8be334ed1b57a90e8bdb2027699f86a1

Merge pull request #39 from psycowithespn/gpio_af_od OTy is 1 for open drain, not 0

view details

psycowithespn

commit sha e2272e6c930997d924c3ecdcf37f3a8c96b4d70c

Update the GPIO mode register after setting AF

view details

Patrick Seidel

commit sha c7b6d535dc8d1ae083b93d3b3d77ac0e622b982b

Set the moder register last in all instances

view details

Daniel Egger

commit sha 4ebab3d37c7f0febaa2490917dbf0af68cd707e6

Merge pull request #41 from psycowithespn/patch-1 Update the GPIO mode register after setting AF

view details

Tim Docker

commit sha c59b9f185da529fc24f85300162d5b21134934dd

Added support for serial port idle interrupts

view details

Aurelien Jacobs

commit sha 9d5235c85f47be5b7a71fecebab429cb8953008c

rcc: add support for every stm32f4 devices

view details

Aurelien Jacobs

commit sha 97e63a8405bb8e6d8f2c97e1357ac3b9f4e668c2

timer: add support for every stm32f4 devices

view details

Aurelien Jacobs

commit sha 85fe3142024e7007eb67010f94622a8bceb3692c

gpio: add support for every stm32f4 devices

view details

Aurelien Jacobs

commit sha f00ba5a39af09f761d08528acdbf453bd90f757e

spi: reorganize features filtering to ease addition of other devices

view details

push time in 14 hours

create barnchbirkenfeld/stm32f4xx-hal

branch : intr-tip

created branch time in 14 hours

issue commentstm32-rs/stm32f4xx-hal

UART8 interrupt not found

Just the name being wrong doesn't prevent the interrupt from working... Did you unmask the USART8 interrupt on the NVIC peripheral?

Maldus512

comment created time in 14 hours

PR opened PyO3/pyo3

guide: show exporting create_exception! exceptions in a module

This was asked about in Gitter; #805 seemed to suggest to them that it is not possible.

+17 -0

0 comment

1 changed file

pr created time in 17 hours

create barnchbirkenfeld/pyo3

branch : guide-exc

created branch time in 17 hours

pull request commentPyO3/pyo3

Py::as_ref and Py::into_ref (remove AsPyRef)

Ah, good point. I did not realize that as_ref had the self lifetime and the Python lifetime tied to the return's lifetime. (I'm sure there is a reason this is necessary?)

davidhewitt

comment created time in 21 hours

pull request commentstm32-rs/stm32-eth

Add reproducer example for #10

I'm not seeing the ARP request on wireshark. (I made sure that with the slower rate I see both request and reply.)

birkenfeld

comment created time in a day

Pull request review commentPyO3/pyo3

Py::as_ref and Py::into_ref (remove AsPyRef)

 where         let ob = unsafe { Py::from_owned_ptr(py, obj as _) };         Ok(ob)     }+}++impl<T> Py<T>+where+    T: PyTypeInfo,+{+    /// Borrows a GIL-bound reference to the contained `T`. By binding to the GIL lifetime, this+    /// allows the GIL-bound reference to not require `Python` for any of its methods.+    ///+    /// For native types, this reference is `&T`. For pyclasses, this is `&PyCell<T>`.+    ///+    /// # Examples+    /// Get access to `&PyList` from `Py<PyList>`:+    ///+    /// ```+    /// # use pyo3::prelude::*;+    /// # use pyo3::types::PyList;+    /// # Python::with_gil(|py| {+    /// let list: Py<PyList> = PyList::empty(py).into();+    /// let list: &PyList = list.as_ref(py);+    /// assert_eq!(list.len(), 0);+    /// # });+    /// ```+    ///+    /// Get access to `&PyCell<MyClass>` from `Py<MyClass>`:+    ///+    /// ```+    /// # use pyo3::prelude::*;+    /// #[pyclass]+    /// struct MyClass { }+    /// # Python::with_gil(|py| {+    /// let my_class: Py<MyClass> = Py::new(py, MyClass { }).unwrap();+    /// let my_class_cell: &PyCell<MyClass> = my_class.as_ref(py);+    /// assert!(my_class_cell.try_borrow().is_ok());+    /// # });+    /// ```+    pub fn as_ref<'py>(&'py self, _py: Python<'py>) -> &'py T::AsRefTarget {+        let any = self.as_ptr() as *const PyAny;+        unsafe { PyNativeType::unchecked_downcast(&*any) }+    } +    /// Similar to [`as_ref`](#method.as_ref), but instead consumes this `Py` and registers the+    /// Python object reference in PyO3's object storage. The reference count for the Python+    /// object will not be decreased until the GIL lifetime ends.+    ///+    /// # Examples

These are the same examples as above, with as_ref changed to into_ref. Instead, it would be nice to (sorry, again) mention the differences and show something that can't be done with as_ref.

davidhewitt

comment created time in a day

Pull request review commentPyO3/pyo3

Py::as_ref and Py::into_ref (remove AsPyRef)

 pub unsafe trait PyNativeType: Sized {     } } -/// A Python object of known type.+/// A Python object of known type T. ///-/// Accessing this object is thread-safe, since any access to its API requires a-/// `Python<'py>` GIL token.+/// Accessing this object is thread-safe, since any access to its API requires a `Python<'py>` GIL+/// token. There are a few different ways to use the Python object contained:+///  - [`Py::as_ref`](#method.as_ref) to borrow a GIL-bound reference to the contained object,+///  - [`Py::borrow`](#method.borrow), [`Py::try_borrow`](#method.try_borrow),+///    [`Py::borrow_mut`](#method.borrow_mut), or [`Py::try_borrow_mut`](#method.try_borrow_mut),+///    to directly access a `#[pyclass]` value (which has RefCell-like behavior, see+///    [the `PyCell` guide entry](https://pyo3.rs/master/class.html#pycell-and-interior-mutability)+///    ).+///  - Use methods directly on `Py`, such as [`Py::call`](#method.call) and+///    [`Py::call_method`](#method.call_method). /// /// See [the guide](https://pyo3.rs/master/types.html) for an explanation /// of the different Python object types. ///-/// Technically, it is a safe wrapper around `NonNull<ffi::PyObject>` with+/// `Py<T>` is implemented as a safe wrapper around `NonNull<ffi::PyObject>` with

Do we need this sentence? It always struck me as more confusing than helpful to the user, and the hardcore developer will click the [src] link anyway to check it out.

davidhewitt

comment created time in a day

Pull request review commentPyO3/pyo3

Py::as_ref and Py::into_ref (remove AsPyRef)

 pub unsafe trait PyNativeType: Sized {     } } -/// A Python object of known type.+/// A Python object of known type T. ///-/// Accessing this object is thread-safe, since any access to its API requires a-/// `Python<'py>` GIL token.+/// Accessing this object is thread-safe, since any access to its API requires a `Python<'py>` GIL+/// token. There are a few different ways to use the Python object contained:+///  - [`Py::as_ref`](#method.as_ref) to borrow a GIL-bound reference to the contained object,
///  - [`Py::as_ref`](#method.as_ref) to borrow a GIL-bound reference to the contained object.
davidhewitt

comment created time in a day

Pull request review commentPyO3/pyo3

Py::as_ref and Py::into_ref (remove AsPyRef)

 Can be cloned using Python reference counts with `.clone()`. # let py = gil.python(); let list: Py<PyList> = PyList::empty(py).into(); -// Access the native type using AsPyRef::as_ref(py)-// (For #[pyclass] types, as_ref() will return &PyCell<T>)+// Access the native type using Py::as_ref(py) or Py::into_ref(py)+// (For #[pyclass] types, these will return &PyCell<T>) let _: &PyList = list.as_ref(py);+let _: &PyList = list.clone().into_ref(py);

Describe difference(s) here?

davidhewitt

comment created time in a day

pull request commentPyO3/pyo3

Py::as_ref and Py::into_ref (remove AsPyRef)

I'm confused by into_ref. In what cases do you need to / should you use this instead of using as_ref and letting the Py be dropped naturally?

davidhewitt

comment created time in a day

delete branch birkenfeld/stm32f4xx-hal

delete branch : enable-overdrive

delete time in 2 days

issue commentstm32-rs/stm32-eth

Trying to achieve max bandwidth results in (some) packets not being sent

I've put up the reproducing example as #21, I've not yet experimented with dcache.

birkenfeld

comment created time in 2 days

PR opened stm32-rs/stm32-eth

Add reproducer example for #10

This isn't intended to be merged, but as an easy way to submit and discuss my example to reproduce the issue in #10.

Short guide: adapt the IPs in src/examples/repro-issue10.rs to something that works with your setup. Then build/flash with

cargo run --release --example repro-issue10 --features "stm32f429 smoltcp-phy log smoltcp/socket-udp smoltcp/socket-icmp smoltcp/log smoltcp/verbose"

and then run the python script like

python3 repro-issue10.py device_ip 54321

It should produce output like

[ 0.500643] got: 4137 packets => 100.0 MBit/s
[ 1.001294] got: 8276 packets => 100.0 MBit/s
...

with the issue appearing around some full-minute mark (because smoltcp sends its ARP re-request then), usually after the first minute. It will looks like

65.081747] got: 538058 packets => 100.0 MBit/s
[65.582411] got: 542197 packets => 100.0 MBit/s
[66.083122] got: 543189 packets => 99.4 MBit/s
[66.583887] got: 543189 packets => 98.7 MBit/s
[67.084575] got: 543189 packets => 97.9 MBit/s

i.e. no more packets are received.

The issue can be made to go away by introducing more wait time between sending packets; with the constant PKT_EVERY at the top set to 1240 the data rate is still virtually 100 MBit/s but I don't see the issue anymore.

Let me know if anything is unclear, the code is adapted from the real thing so some implementation choices that look odd might stem from there.

+262 -0

0 comment

3 changed files

pr created time in 2 days

create barnchbirkenfeld/stm32-eth

branch : repro-issue10

created branch time in 2 days

PR opened stm32-rs/stm32f4xx-hal

Enable the voltage regulator overdrive

for MCUs that support overclocking to 180 MHz. The reference manual states that this can be done while waiting for PLL lock.

Fixes #196

+22 -0

0 comment

2 changed files

pr created time in 2 days

push eventbirkenfeld/stm32f4xx-hal

Georg Brandl

commit sha 1f3ded73fcf6b61f00da20653ce9e8b87f04de0f

Enable the voltage regulator overdrive for MCUs that support overclocking to 180 MHz. The reference manual states that this can be done while waiting for PLL lock. Fixes #196

view details

push time in 2 days

create barnchbirkenfeld/stm32f4xx-hal

branch : enable-overdrive

created branch time in 2 days

issue commentstm32-rs/stm32f4xx-hal

Enable voltage overdrive for HCLK > 168 MHz?

Sure, I'm on it.

birkenfeld

comment created time in 2 days

delete branch birkenfeld/stm32-eth

delete branch : allow-180mhz

delete time in 2 days

push eventbirkenfeld/stm32-eth

Thales Fragoso

commit sha ac44392042afafe11b168e2887adea8df5ba2190

Remove unnecessary smoltcp features

view details

Adam Greig

commit sha 9449a2620d190b7ff38ef9a1c6201382a5970295

Merge pull request #19 from thalesfragoso/less-feats Remove unnecessary smoltcp features

view details

Thales

commit sha f8faf0beed87c0f59a4efbfdab5fb688388f9a83

Merge pull request #20 from birkenfeld/allow-180mhz Remove maximum limit on HCLK

view details

push time in 2 days

issue commentstm32-rs/stm32-eth

Trying to achieve max bandwidth results in (some) packets not being sent

Will do; should be ready later today.

birkenfeld

comment created time in 2 days

pull request commentstm32-rs/stm32-eth

Fill in device capabilities

Oh, I made this PR from the master branch and this was overridden. But no matter, since this should have been closed anyway :)

birkenfeld

comment created time in 2 days

issue openedstm32-rs/stm32f4xx-hal

Enable voltage overdrive for HCLK > 168 MHz?

The reference manual RM0090 states that for HCLK > 168 MHz, the over-drive mode should be enabled (the procedure is on page 123). I have run some devices at 180 MHz without over-drive and not seen problems, but would it be more proper to do this in RCC.freeze() if indicated?

created time in 3 days

push eventbirkenfeld/stm_ethernet

Georg Brandl

commit sha b008e16ffad920e34f6a718156af08765d6cb995

update to newest dependencies

view details

push time in 3 days

push eventbirkenfeld/stm32-eth

Georg Brandl

commit sha 437e2c72a87e0c661ed0f9ecec46f7b0e81a5b70

Remove maximum limit on HCLK The limits stated by the ref. manuals are simply the maximum clocks that are officially supported by the chips. For ETH, it's only important to be above 25 MHz.

view details

push time in 3 days

pull request commentstm32-rs/stm32-eth

Allow up to 180 MHz clock for the F4.

Thanks, updated!

birkenfeld

comment created time in 3 days

push eventbirkenfeld/stm32-eth

Georg Brandl

commit sha 437e2c72a87e0c661ed0f9ecec46f7b0e81a5b70

Remove maximum limit on HCLK The limits stated by the ref. manuals are simply the maximum clocks that are officially supported by the chips. For ETH, it's only important to be above 25 MHz.

view details

push time in 3 days

push eventbirkenfeld/stm32-eth

Georg Brandl

commit sha 2313f0b415f0fee8fa01db4120d7b9d226873ac3

Allow up to 180 MHz clock for the F4. The ref. manual (RM0090) is inconsistent here: the table 187 on page 1129 states 180 MHz (to which the chip can be overclocked) while the register description on page 1197 states 168 MHz.

view details

push time in 3 days

issue commentstm32-rs/stm32-eth

Trying to achieve max bandwidth results in (some) packets not being sent

Unfortunately, I tested with current master, with the "fence" feature both disabled and enabled, and could reproduce the problem. I was using HCLK 180 MHz (see the PR I just submitted), but I see the same with 168 MHz.

Is #16 still relevant? Is there an example how to put the buffers in SRAM2?

birkenfeld

comment created time in 3 days

PR opened stm32-rs/stm32-eth

Allow up to 180 MHz clock for the F4.

The ref. manual (RM0090) is inconsistent here: the table 187 on page 1129 states 180 MHz (to which the chip can be overclocked) while the register description on page 1197 states 168 MHz.

+8 -7

0 comment

4 changed files

pr created time in 3 days

create barnchbirkenfeld/stm32-eth

branch : allow-180mhz

created branch time in 3 days

push eventbirkenfeld/stm32-eth

Georg Brandl

commit sha fb129a7818fe4cb40ab0e57d1964ccbab92435f1

Fill in the checksum capabilities of the device.

view details

push time in 4 days

push eventbirkenfeld/stm32-eth

Daniel Jones

commit sha 70f8260caa842ca6ad07080d44f445b4ef4c4634

Changed to work with stm32f7xx

view details

Daniel Jones

commit sha 63e85086b8716dc09900c888eb6e28cf7a80ea87

Correct Device capabilities, fix NVIC warning

view details

Daniel Jones

commit sha 2921e7497529d29e709df0b8dcb7f2366fb3c5e2

Changed clock configuration.

view details

Daniel Jones

commit sha 39d9d9b58f8dd65d959e777132ca6aada525b1fd

Fixed issue with ping responding only half the time Have to wait for the memory cache to syncronize before enabling the ethernet TX DMA

view details

Daniel Jones

commit sha 1195819cb5b8c5c168f4f9a0328547543ad93dc0

fixed cargo dependency

view details

Daniel Jones

commit sha c8a1e16f2c4c3026921b4291f53d9b21dd094f0e

Added git ignore

view details

Daniel Jones

commit sha 4a69913ce0474463dafde1c730f5f20fee933ac5

import as device instead of stm32

view details

Torkel Danielsson

commit sha 6d521c8ce2455e3be4d07ca691f32e9e70cb6be1

cargo fmt

view details

Astro

commit sha 54dd6115dd645b72c5ba01176426ca14c823b3ff

Merge pull request #11 from torkeldanielsson/rustfmt rustfmt

view details

dtjones190

commit sha 78124e35a99ff8a25989ab0b1b9504035c9300ff

use main hal crate

view details

dtjones190

commit sha 1ddd1b6e01f44c22985fe7b73bdba7b18c871527

Support both f4xx and f7xx

view details

dtjones190

commit sha 032636d57948d73fe7bcbfff351229ac01794f79

Cargo fmt

view details

dtjones190

commit sha 441ecf838f8f8a1b518fd9a0a67a937992193fc7

Merge remote-tracking branch 'upstream/master'

view details

dtjones190

commit sha 1ca0be03994b805f3411129877f17bddb388ef19

Examples build

view details

dtjones190

commit sha 10f6cc54f99e9a93f20edaeaff89fa087af094c9

Set clock range

view details

dtjones190

commit sha f65e41ef4ec9792e0ae1297f4f70004d1ecf353e

cargo fmt

view details

dtjones190

commit sha 96c14a66384c98292acfc0eab931da77a32b3e4c

updated cargo package details

view details

Thales Fragoso

commit sha ec5e5413286b2c550a5187e7f9fb659bf69aa8b1

Change to bit-banding and support all f4 boards

view details

Thales Fragoso

commit sha 4b133c0dd75b9777dcc809cc18cf6b7856de9d0e

clippy clean-up

view details

Thales Fragoso

commit sha a139265f2ae7ae5920d13ea1360bb71d4326ddc9

Fix examples

view details

push time in 4 days

issue commentPyO3/pyo3

Iterator examples without `Clone`

There is obviously no way when using vec::IntoIter, but that is also not really necessary.

The iterator type should just need a reference to the Py object, and an index.

davidhewitt

comment created time in 5 days

push eventpygments/pygments.github.io

Anteru

commit sha 3d10fdcd35ae0c0ce600c8de6a0af22459898a12

Automated deployment: Wed Aug 5 19:28:28 UTC 2020 bc4168d3ce89ae56b50c53d76e7ed50793873698

view details

push time in 6 days

push eventpygments/pygments.github.io

Anteru

commit sha 4eab7a78bce014e1bd0440e373a557fad844c1a6

Automated deployment: Wed Aug 5 18:11:12 UTC 2020 609cda16415c3e8c8ac7ff80059ab5b7b62af033

view details

push time in 6 days

pull request commentPyO3/pyo3

Added Rust initialisation of Python-allocated bytes

Yeah, that's a tricky one. While MemoryError is likely to be the error there, it's also possible for arbitrary user code to run e.g. from the tp_alloc slot.

Right, although I would have expected that for the types that are allowed there no fancy tp_alloc is possible.

Have you got examples where Py::new returning PyResult is not ergonomic?

I was using some closure heavy code where it can be a pain to thread the Results through to the toplevel. But I don't think it's a big issue.

MoritzLangenstein

comment created time in 6 days

pull request commentPyO3/pyo3

Added Rust initialisation of Python-allocated bytes

And Py::new, unfortunately.

MoritzLangenstein

comment created time in 6 days

pull request commentPyO3/pyo3

Added Rust initialisation of Python-allocated bytes

I don't see why PyO3 should go out of its way not panicking for out-of-memory while the standard library does.

MoritzLangenstein

comment created time in 7 days

pull request commentPyO3/pyo3

Update indoc requirement from 0.3.4 to 1.0.2

Another update that breaks 1.39 compatibility.

dependabot-preview[bot]

comment created time in 8 days

issue closedpygments/pygments

Can you add language shortnames to the documentation?

I often look through this page https://pygments.org/languages/ to check which languages I can use with Pygments, but it lacks an important piece of information - the short name for specifying the language.

By "short name", I mean the "language name" part after the opening fence, as shown below:

```ruby
#  ^^^^ This part
```

It's too common the case that I have to iterate through the Python code in pygments/lexers to determine which short name I should use. For example, it wasn't intuitive enough that the Python console session has a short name of pycon, when we usually don't refer to that feature with "console", but rather "REPL".

May I ask that the short names for each supported language be listed on the documentation page? As far as I am concerned, one short name for each language would be enough.

closed time in 9 days

iBug

issue commentpygments/pygments

Can you add language shortnames to the documentation?

They are all listed on https://pygments.org/docs/lexers/ which is automatically generated from the source code. Maintaining that list manually on /languages would get out of date quickly.

iBug

comment created time in 9 days

issue commentPyO3/pyo3

Minimum supported Rust version - policy

Well, as a developer, of course. When I deploy stuff, I try using the toolchains available on those systems.

But for now I agree with (2), as long as Rust's iteration cycle and pace of development is still pretty high it makes sense not to drag too much.

davidhewitt

comment created time in 9 days

push eventpygments/pygments.github.io

Anteru

commit sha b1af227e634d85c70a8463ca6706ea2f0ae82a28

Automated deployment: Sun Aug 2 10:14:52 UTC 2020 755f0f4f104fdbcc57f1f025a9638239d6de6e1a

view details

push time in 9 days

pull request commentPyO3/pyo3

Make `PyObject` a type alias of `Py<PyAny>` (& remove `FromPy`)

I guess it's pretty meh for the old guard who is familiar with all the types already, but IMO will make it much easier for newcomers.

davidhewitt

comment created time in 10 days

push eventpygments/pygments.github.io

Anteru

commit sha 9357ac24706f7af8961d5861ce2d91e041ae2672

Automated deployment: Thu Jul 30 18:48:49 UTC 2020 eaab40379c0c55e5549f67097701abb99123a6e0

view details

push time in 12 days

pull request commentPyO3/pyo3

Update paste requirement from 0.1.6 to 1.0.0

There's probably a similar question with Debian/Ubuntu, but don't have an idea about their release/toolchain cycles.

dependabot-preview[bot]

comment created time in 13 days

issue commentethercat-rs/ethercat

Release v0.2

:+1: - I had no time to review the PRs due to holidays, but it all looks good.

flosse

comment created time in 13 days

pull request commentPyO3/pyo3

Update paste requirement from 0.1.6 to 1.0.0

Sounds like a pretty unnecessary bump -- paste 0.1.6 works without problems, no?

dependabot-preview[bot]

comment created time in 13 days

MemberEvent

pull request commentrust-lang/rust

Mark `-1` as an available niche for file descriptors

Alternatively, make it possible in rustc to specify the bound as -2 which should keep the correct semantics even for a 64 bit c_int.

notriddle

comment created time in 16 days

Pull request review commentrust-lang/rust

Mark `-1` as an available niche for file descriptors

 use crate::sys_common::AsInner; use libc::{c_int, c_void};  #[derive(Debug)]+#[rustc_layout_scalar_valid_range_start(0)]+// libstd/os/raw/mod.rs assures me that every Rust-supported platform has a+// 32-bit c_int. Below is -2, in two's complement, but that only works out

I guess this means "every Rust-supported platform for which std is available"?

notriddle

comment created time in 18 days

PR closed mlz-ictrl/nicos

Discard master and slave terminology

For diversity reasons, it would be nice to try to avoid 'master' and 'slave' terminology in this repository which can be associated to slavery. The master-slave terminology could be problematic for people in several countries which has the history of slavery like Romania, USA and many others. Thank you for considering the proposal. Let me know if any changes in the PR are needed, I would be happy to implement them.

+556 -556

1 comment

131 changed files

bopopescu

pr closed time in 18 days

pull request commentmlz-ictrl/nicos

Discard master and slave terminology

This repository is only a mirror.

bopopescu

comment created time in 18 days

delete branch birkenfeld/stm_display_rust

delete branch : wip

delete time in 19 days

push eventbirkenfeld/stm_display_rust

Georg Brandl

commit sha 3aacf9e8d2bbae0ef0a3a8e2ed1e2d2ce50ac817

make very-large font slightly smaller

view details

Georg Brandl

commit sha 169cb8ca38b8d80be64f4c6cd342bc87172295bd

version bump

view details

Georg Brandl

commit sha 186f19941c52ba59fb1d1826bd01739b1fbf2163

add a command to reset the APU

view details

Georg Brandl

commit sha b1315884875f510f152b10e24d54b9b66bfdb651

dependency update

view details

Georg Brandl

commit sha 44de54776bdcb7d8b43ff7bafd45b9a995d11da7

optimization: only update buffer when something can have changed

view details

Georg Brandl

commit sha 162978dbbb03f977793711413b42228dedc481bb

add question mark to the very large font

view details

Georg Brandl

commit sha 8898e0dfa030901b57ba265aa6fb8a420e8e7233

bump version to 1.13

view details

push time in 19 days

push eventbirkenfeld/stm_display_rust

Georg Brandl

commit sha 047622f983068430417f7548944cf092c410f3f6

bump version to 1.13

view details

push time in 20 days

push eventbirkenfeld/stm_display_rust

Georg Brandl

commit sha 87010e27d1217a60720572ab71c70cb30dbae453

add question mark to the very large font

view details

push time in 20 days

issue commentPyO3/pyo3

Accepting Union types for function arguments

It can be even simpler in extract with something like

if let Ok(s) = ob.extract() {
    return Ok(Union::Str(s))
} else if let Ok(i) = ob.extract() {
    ...

I guess a derive macro for FromPyObject for such enums could be in the scope of pyo3.

mehcode

comment created time in 20 days

issue commentrust-lang/rustup

Error on update leading to rollback

It was merged like 10 minutes ago, what do you expect? Nightlies are built once a day - well, night :).

conikeec

comment created time in 20 days

push eventpygments/pygments.github.io

Anteru

commit sha 26e282b45ad50e7e667d346fc5bae557ee428901

Automated deployment: Tue Jul 21 19:07:28 UTC 2020 a486735f2b485ed35bcb60101fc9a3e2a0eca11d

view details

push time in 21 days

issue commentPyO3/pyo3

Accepting Union types for function arguments

I think this is a hopelessly complex topic and you're better off taking a &PyAny and doing the extraction yourself.

(Stdlib functions implemented C do the same.)

mehcode

comment created time in 21 days

pull request commentpygments/pygments

Improve Markdown lexer

LGTM.

Leistungsabfall

comment created time in 21 days

PR opened jmesmon/rust-systemd

Rerun build.rs if non-pkg_config env var changes

I ran into this when I defined the env var wrongly at the first try, and then wondered why none of my changes seemed to have an effect.

+1 -0

0 comment

1 changed file

pr created time in 21 days

push eventbirkenfeld/rust-systemd

Georg Brandl

commit sha 6d68014a7181de5e8e938f2ffe93b2ea219e6bd4

Rerun build.rs if non-pkg_config env var changes I ran into this when I defined the env var wrongly at the first try, and then wondered why none of my changes seemed to have an effect.

view details

push time in 21 days

issue commentPyO3/pyo3

Function argument error handling improvements

One way would be to use a custom TypeError subclass that can be recognized in error-handling code and therefore have its message easily amended.

davidhewitt

comment created time in 22 days

pull request commentPyO3/pyo3

Replace `extension-module` feature with `PYO3_MAKE_EXTENSION_MODULE`

Seems to be a reason for me to try out maturin :)

davidhewitt

comment created time in a month

issue commentstm32-rs/stm32-eth

Trying to achieve max bandwidth results in (some) packets not being sent

I'm using an F429. Thanks for the suggestions, I will try master and stuff from #16 when I'm back at work.

birkenfeld

comment created time in a month

issue commentpygments/pygments

[RFC/idea] Support for (global) user configuration

I can provide a one-module Toml parser if necessary, I've written that already for another project.

blueyed

comment created time in a month

Pull request review commentethercat-rs/ethercat

Add 'get_sdo' and 'get_sdo_entry' methods

 pub struct SdoIndex {     pub subindex: u8, } +#[derive(Debug, Clone)]+pub struct SdoInfo {+    pub slave_position: u16,+    pub position: u16,+    pub index: u16,+    pub max_subindex: u8,+    pub object_code: u8,+    pub name: String,+}++#[derive(Debug, Clone, Copy)]+pub enum Access {+    Unknown,+    ReadOnly,+    WriteOnly,+    ReadWrite,+}++#[derive(Debug, Clone)]+pub struct SdoEntryAccess {+    pub pre_op: Access,+    pub safe_op: Access,+    pub op: Access,+}++impl From<(u8, u8)> for Access {+    fn from((read, write): (u8, u8)) -> Self {+        match (read, write) {+            (0, 1) => Access::ReadOnly,+            (1, 0) => Access::WriteOnly,+            (1, 1) => Access::ReadWrite,+            _ => Access::Unknown,

Yes!

flosse

comment created time in a month

push eventbirkenfeld/serde-pickle

Georg Brandl

commit sha 9e267e6790d4dcce092235b4374eab48496933e6

bump to 0.6.1

view details

push time in a month

push eventbirkenfeld/serde-pickle

Georg Brandl

commit sha 5fab80e1b43a3f417b152a97c6947584a25315bd

Support deserializing the enum representation chosen by serde_json/serde_yaml which uses just "name" for unit variants and {"name": data} for others. see #9

view details

push time in a month

issue commentbirkenfeld/serde-pickle

Strange handling of enums (decoding error: enums must be tuples)

Yes, I may switch it for 1.0, while also changing the serializing APIs from a single bool option (for proto 3) to an extensible struct.

Palladinium

comment created time in a month

issue commentPyO3/pyo3

mod_wsgi and pyo3 module usage in different WSGIApplicationGroup

Note that I'm not a developer of PyO3, just a user, so don't take this as gospel :)

kushaldas

comment created time in a month

issue commentbirkenfeld/serde-pickle

Strange handling of enums (decoding error: enums must be tuples)

You're right, this is strange. I don't remember a reason for using a different method here.

For compatibility reasons, I'm not eager to change the serialize side, but it is no problem to accept both formats on the deserialize side. Would that be ok for your use case?

Palladinium

comment created time in a month

issue commentbirkenfeld/serde-pickle

How to deserialize enums that fail with error "decoding error: enums must be tuples"?

Just for clarification, @Palladinium 's comment isn't applicable here (but it is a legitimate issue, see #9). Whether serde-pickle uses dicts or tuples for externally tagged enum representation, it would in no case work with the @L0g4n 's data without using #[serde(untagged)].

L0g4n

comment created time in a month

issue commentPyO3/pyo3

mod_wsgi and pyo3 module usage in different WSGIApplicationGroup

AFAIK subinterpreters are not (yet) separated enough for mod_wsgi's usage of them to be anything but security by obscurity.

In case this is hard to fix in PyO3: It is well documented in the mod_wsgi docs how to circumvent this problem, and for now I don't think this would be worth a degrading of PyO3 API or performance.

kushaldas

comment created time in a month

issue commentrust-lang/rust

rustdoc: some trait methods appear as "hidden undocumented items"

@GuillaumeGomez what about my minimal suggestion to change "undocumented" to "documented in trait"?

eminence

comment created time in a month

Pull request review commentethercat-rs/ethercat

Add 'get_sdo' and 'get_sdo_entry' methods

 impl Master {         })     } +    pub fn get_sdo(&mut self, slave_index: u16, sdo_position: u16) -> Result<SdoInfo> {+        let mut sdo = ec::ec_ioctl_slave_sdo_t::default();+        sdo.slave_position = slave_index;+        sdo.sdo_position = sdo_position;+        ioctl!(self, ec::ioctl::SLAVE_SDO, &mut sdo)?;+        Ok(SdoInfo {+            slave_position: sdo.slave_position,+            position: sdo.sdo_position,+            index: sdo.sdo_index,+            max_subindex: sdo.max_subindex,+            object_code: sdo.object_code,+            name: raw_array_to_string(&sdo.name),+        })+    }++    pub fn get_sdo_entry(+        &mut self,+        slave_index: u16,+        sdo_spec: i32,

the format for sdo_spec seems to be nontrivial: if I read correctly, negative numbers are "by position", positive are sdo indices. That should be wrapped in an enum on the Rust side.

Maybe even include the subindex?

flosse

comment created time in a month

Pull request review commentethercat-rs/ethercat

Add 'get_sdo' and 'get_sdo_entry' methods

 impl Master {     // reference_clock_time, sync_monitor_queue, sync_monitor_process } +fn raw_array_to_string(arr: &[i8; 64]) -> String {+    let s = arr+        .iter()+        .filter(|x| **x != 0)+        .map(|x| *x as u8)+        .collect::<Vec<_>>();+    String::from_utf8_lossy(&s).to_string()

I'm not sure of the encoding here, although it's probably not UTF-8 :) I suspect latin1 or windows1252.

flosse

comment created time in a month

Pull request review commentethercat-rs/ethercat

Add 'get_sdo' and 'get_sdo_entry' methods

 impl Master {     // reference_clock_time, sync_monitor_queue, sync_monitor_process } +fn raw_array_to_string(arr: &[i8; 64]) -> String {+    let s = arr+        .iter()+        .filter(|x| **x != 0)

why are NULs filtered, is it not a NUL terminated string?

flosse

comment created time in a month

Pull request review commentethercat-rs/ethercat

Add 'get_sdo' and 'get_sdo_entry' methods

 pub struct SdoIndex {     pub subindex: u8, } +#[derive(Debug, Clone)]+pub struct SdoInfo {+    pub slave_position: u16,+    pub position: u16,+    pub index: u16,+    pub max_subindex: u8,+    pub object_code: u8,+    pub name: String,+}++#[derive(Debug, Clone, Copy)]+pub enum Access {+    Unknown,+    ReadOnly,+    WriteOnly,+    ReadWrite,+}++#[derive(Debug, Clone)]+pub struct SdoEntryAccess {+    pub pre_op: Access,+    pub safe_op: Access,+    pub op: Access,+}++impl From<(u8, u8)> for Access {+    fn from((read, write): (u8, u8)) -> Self {+        match (read, write) {+            (0, 1) => Access::ReadOnly,+            (1, 0) => Access::WriteOnly,+            (1, 1) => Access::ReadWrite,+            _ => Access::Unknown,

I don't know, but looking at the master code:

  • the access mode is read directly from the device
  • the mode doesn't seem to be checked by the master

So a badly implemented device could presumably return (0,0) for the access but still process read and/or write requests when the respective ioctls are called.

flosse

comment created time in a month

issue commenterickt/rust-zmq

Implement `Display` and `Debug` for `Context` and `Socket`

Debug sounds good, but why Display? It isn't implemented for std sockets either.

TheButlah

comment created time in a month

push eventpygments/pygments.github.io

Anteru

commit sha 305b1d9610c3b0329b7ba65f1dfc759cd3f56300

Automated deployment: Sat Jul 4 16:10:54 UTC 2020 728fd19ebcb69ddb2c7af159939e1a19ae53a892

view details

push time in a month

issue commentbirkenfeld/serde-pickle

How to deserialize enums that fail with error "decoding error: enums must be tuples"?

I think you should use #[serde(untagged)] for the enum to do that. See https://serde.rs/container-attrs.html for details.

L0g4n

comment created time in a month

issue commentsphinx-doc/sphinx

C domain changes of Sphinx 3 prevent to write doc compatible with Sphinx 2 and Sphinx 3

IMO (keep in mind, I'm just a watcher at this point): it's fine to introduce more strictness if

  • the "corrected" way works in 2 and 3, or
  • the new strictness can be switched off or
  • made into "harmless" warnings (but keep in mind that some fanatics set -W by default and don't understand compatibility compromises)

So I would vote for a fix here that enables any of these mitigations.

vstinner

comment created time in a month

issue commentpygments/pygments

Weird highlighting of Matlab lexer

OK, I can reproduce with 2.6.1. This seems to have been introduced recently.

duskmoon314

comment created time in a month

push eventpygments/pygments.github.io

Anteru

commit sha 50fec178422ea41d019880a25d3b349147f53847

Automated deployment: Tue Jun 30 08:51:12 UTC 2020 b5577a68a9c286f4bce157d63e8c83ed8d70e704

view details

push time in a month

issue commentpygments/pygments

Swift Lexer: incorrect tokens created for comments

Note that although it is an inefficiency, this isn't a bug. Runs of tokens with the same type are coalesced as needed while formatting the output.

cchang197

comment created time in a month

issue commentpygments/pygments

Weird highlighting of Matlab lexer

If you post the code as text, together with a minimal LaTeX snippet using minted, I can try to reproduce here. But I suspect it's not a Pygments problem, since the demo output looks ok.

duskmoon314

comment created time in a month

pull request commentPyO3/pyo3

Introduce #[pyclass(unsendable)]

Why does the stub have the type argument btw? (For the "real" checker it's used to format the panic message)

kngwyu

comment created time in a month

pull request commentPyO3/pyo3

Mention `send_wrapper` in the migration guide

This change showed both possibilities, so it's definitely helpful when the contents are not threadsafe after all.

davidhewitt

comment created time in a month

more