开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

subst.py and gps.py module


 

Hello,

Started converting / testing the subst.py module.

It does not work in the existing code as near as I can determine, and has an infinite loop in it once other bugs in it are fixed.

Just about 1/2 of the functions in the modules have bugs in it, and fixing those are done basically done by removing most of those because they are effectively doing almost nothing.

The only caller of this module is the gps.py.

It appears to be intended to do a replacement of the text between two slash characters in the comment section of the GPS message, if that text is found in a configuration file.

If not, the text is supposed to be passed through unchanged. It actually just removes the text in the current implementation.

The caller in gps.py discards the result of the conversion, so all this code is doing is wasting space in memory and in the repository.

I am thinking of just yanking this module out, other than trying to get it implemented correctly.

As it is currently implemented, it is creating a new copy of the conversion substitution object for every GPSPosition object in d-rats, as as these are used in the map point functions, there could be lots of them.

It would have to be re-written to be what is known as a Singleton object if it is to be retained to avoid the needless memory overhead.

73,
-John


 

John,

As a fellow software engineer, I read through your thorough and thoughtful description of subst.py and support your decision to toss the buggy module out.

73,

On Sat, Apr 16, 2022 at 11:08 AM John E. Malmberg <wb8tyw@...> wrote:
Hello,

Started converting / testing the subst.py module.

It does not work in the existing code as near as I can determine, and
has an infinite loop in it once other bugs in it are fixed.

Just about 1/2 of the functions in the modules have bugs in it, and
fixing those are done basically done by removing most of those because
they are effectively doing almost nothing.

The only caller of this module is the gps.py.

It appears to be intended to do a replacement of the text between two
slash characters in the comment section of the GPS message, if that text
is found in a configuration file.

If not, the text is supposed to be passed through unchanged.? It
actually just removes the text in the current implementation.

The caller in gps.py discards the result of the conversion, so all this
code is doing is wasting space in memory and in the repository.

I am thinking of just yanking this module out, other than trying to get
it implemented correctly.

As it is currently implemented, it is creating a new copy of the
conversion substitution object for every GPSPosition object in d-rats,
as as these are used in the map point functions, there could be lots of
them.

It would have to be re-written to be what is known as a Singleton object
if it is to be retained to avoid the needless memory overhead.

73,
-John