Greetings,
I’m sure the problem is with my driver but can anyone reassure me that tox uses an offset of 600 kHz?
In one tox test for my driver, duplex is changed from ‘+’ to ‘split’. The test also points out that we should ignore the offset. That may be a problem for the IC-F520.
The IC-F520 stores the receive and transmit frequencies in each memory without the offset. Rather than write the driver with duplex of only ‘’ and ‘split’, I do a little math to support ‘+’ and ‘-‘ splits when the difference between receive and transmit is 600 kHz (this is a VHF radio).
Thanks! tox test below.
_______________________________________________________________________________________________________ TestCaseBruteForce_Icom_IC-F520.test_duplex ________________________________________________________________________________________________________ [gw7] linux -- Python 3.12.3 /home/joseph/Devl/chirp/.tox/driver/bin/python
self = <tests.TestCaseBruteForce_Icom_IC-F520 testMethod=test_duplex>
@base.requires_feature('valid_duplexes') def test_duplex(self): m = self.get_mem() if 'duplex' in m.immutable: self.skipTest('Test memory has immutable duplex') for duplex in self.rf.valid_duplexes: assert duplex in ["", "-", "+", "split", "off"] if duplex == 'split': self.assertTrue(self.rf.can_odd_split, 'Radio supports split but does not set ' 'can_odd_split=True in features') m.offset = self.rf.valid_bands[0][1] - 100000 else: m.offset = chirp_common.to_kHz(int(m.tuning_step) * 2) m.duplex = duplex # Ignore the offset because we do some fudging on this and we # don't necessarily know the best step to use. What we care about # is duplex here.
self.set_and_compare(m, ignore=['offset'])
tests/test_brute_force.py:106: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/test_brute_force.py:28: in set_and_compare self.assertEqualMem(m, ret_m, **kwargs) tests/base.py:203: in assertEqualMem self.assertEqual(a_vals, b_vals, E AssertionError: {'fre[117 chars]'duplex': '+', 'mode': 'FM', 'comment': '', 'empty': False} != {'fre[117 chars]'duplex': 'split', 'mode': 'FM', 'comment': '', 'empty': False} E {'comment': '', E 'dtcs_polarity': 'NN', E - 'duplex': '+', E ? ^ E E + 'duplex': 'split', E ? ^^^^^ E E 'empty': False, E 'extd_number': '', E 'freq': 136005000, E 'mode': 'FM', E 'name': '', E 'number': 1, E 'skip': '', E 'tmode': '', E 'vfo': 0} : Memories have unexpected differences -------------------------------------------------------------------------------------------------------------------- Captured log call --------------------------------------------------------------------------------------------------------------------- DEBUG chirp.chirp_common:chirp_common.py:1553 Loaded metadata: {'mem_extra': {}, 'rclass': 'DynamicRadioAlias', 'vendor': 'Icom', 'model': 'IC-F520', 'variant': '', 'chirp_version': 'next-20241206'} DEBUG chirp.chirp_common:chirp_common.py:2037 Parsed version 'next-20241206' to (0,) DEBUG chirp.chirp_common:chirp_common.py:2037 Parsed version 'py3dev' to (0,)
I’m sure the problem is with my driver but can anyone reassure me that tox uses an offset of 600 kHz?
Just to be (pedantically) clear, tox is a venv manager, which runs pytest, a generic test framework. The thing caring about offsets are chirp tests and code :)
In one tox test for my driver, duplex is changed from ‘+’ to ‘split’. The test also points out that we should ignore the offset. That may be a problem for the IC-F520.
Lots of radios only store tx/rx frequencies. CHIRP's model is the amateur one (long ago decided, for better or worse) so drivers of these radios have to emulate duplex/offset behavior to meet the model.
This was first (IIRC) addressed by the uv5r driver ages ago, which decided that 70MHz was the limit above which we'd flip to split from duplex:
https://github.com/kk7ds/chirp/blob/master/chirp/drivers/uv5r.py#L945-L956
I'd recommend just mirroring that behavior and you should be good.
--Dan
Thanks. That was the magic.
On Dec 22, 2024, at 16:46, Dan Smith via Developers developers@lists.chirpmyradio.com wrote:
I’m sure the problem is with my driver but can anyone reassure me that tox uses an offset of 600 kHz?
Just to be (pedantically) clear, tox is a venv manager, which runs pytest, a generic test framework. The thing caring about offsets are chirp tests and code :)
In one tox test for my driver, duplex is changed from ‘+’ to ‘split’. The test also points out that we should ignore the offset. That may be a problem for the IC-F520.
Lots of radios only store tx/rx frequencies. CHIRP's model is the amateur one (long ago decided, for better or worse) so drivers of these radios have to emulate duplex/offset behavior to meet the model.
This was first (IIRC) addressed by the uv5r driver ages ago, which decided that 70MHz was the limit above which we'd flip to split from duplex:
https://github.com/kk7ds/chirp/blob/master/chirp/drivers/uv5r.py#L945-L956
I'd recommend just mirroring that behavior and you should be good.
--Dan _______________________________________________ Developers mailing list -- developers@lists.chirpmyradio.com To unsubscribe send an email to developers-leave@lists.chirpmyradio.com
Thanks. That was the magic.
Cool, but also, I forgot until this morning that we codified said magic:
https://github.com/kk7ds/chirp/blob/master/chirp/chirp_common.py#L1908
Might want to use that instead so if we have to change that limit sometime you'll be future proofed.
--Dan
participants (2)
-
Dan Smith
-
Joseph Scanlan