montant / ambit2gpx

Automatically exported from code.google.com/p/ambit2gpx
12 stars 3 forks source link

Documentation/unit testing #9

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

I have a Suunto watch and their website has been down for a couple of days - so 
I was thinking of using this software. Having read the code I noticed that the 
project repository is lacking any sample files or unit tests. Considering the 
various people patching/forking the project this seems like a necessary 
addition. I would also be interested in contributing, but how would I know if I 
had broken something if there are no tests?

While the code is mostly self-documenting it does contain magic conversions 
such as hr*60 + 0.5.... this is not documented, tested or extracted to a method 
in its own right. I am assuming the 60 represents sample per second into sample 
her minute? But what is the 0.5?

I may have written this as: ToMinuteSample( secondsValue ) then inside I may 
have written:

secondsPerMinute=60
strangeConst = 0.5

What do these numbers mean? 80 / 100...

if self.__nb_samples_parsed % 100 == 0:
            sys.stdout.write(".")
            if self.__nb_samples_parsed % (80*100) == 0:
                sys.stdout.write("\n")

There must be a lot you've learnt about the SML file format which the community 
could benefit from if it was written down or better documented etc?

Alex

Original issue reported on code.google.com by alexell...@gmail.com on 23 Dec 2014 at 9:11

GoogleCodeExporter commented 8 years ago
Hi Alex,

I added some comments, specifically on the areas you pointed out. You can 
retrieve them in head version of script when browsing source tab.

A testing framework would be welcome I agree, but I believe it should include a 
loop including a reading of GPX files by another tool working with this format, 
and doing requests on this tool for checking conversion was correct. This is a 
fair amount of work, a bigger work I would say that writing this 100-line long 
script itself. I have not the bandwidth for that.

If you want to contribute, you are very welcome, and working on such test 
framework would be a nice feature to work on, I agree with you.

Regards,

Joël

Original comment by jconr...@gmail.com on 24 Dec 2014 at 11:12