Gary, closer but...

**** could not convert string to float: test of wee_import text updates

===== full terminal output...

12:19 PM $ sudo bin/wee_import --import-config=/home/weewx/csv.conf
--config=/home/weewx/weewx.conf --verbose
Using WeeWX configuration file /home/weewx/weewx.conf
Starting wee_import...
A CSV import from source file '/var/tmp/weewxaddnotes.csv' has been requested.
The following options will be used:
     config=/home/weewx/weewx.conf, import-config=/home/weewx/csv.conf
     source=/var/tmp/weewxaddnotes.csv, from=None, to=None
     dry-run=None, calc_missing=True, ignore_invalid_data=True
     tranche=250, interval=conf, date/time_string_format=%Y-%m-%d %H:%M:%S
     delimiter=',', rain=cumulative, wind_direction=[-360.0, 360.0]
     UV=False, radiation=False
Using database binding 'wx_binding', which is bound to database 'weewx.sdb'
Destination table 'archive' unit system is '0x10' (METRIC).
Missing derived observations will be calculated.
All WeeWX UV fields will be set to None.
All WeeWX radiation fields will be set to None.
Starting import ...
Obtaining raw import data for period 1 ...
The following imported field-to-WeeWX field map will be used:
     source field 'ANComment' as text --> WeeWX field 'ANComment'
     source field 'timestamp' in units 'unix_epoch' --> WeeWX field 'dateTime'
     source field 'extratemp2' in units 'degree_C' --> WeeWX field 'extraTemp2'
     source field 'extratemp1' in units 'degree_C' --> WeeWX field 'extraTemp1'
Raw import data read successfully for period 1.
Mapping raw import data for period 1 ...
Mapped 1 records.
Raw import data mapped successfully for period 1.
Saving mapped data to archive for period 1 ...
1 records identified for import.
Proceeding will save all imported records in the WeeWX archive.
Are you sure you want to proceed (y/n)? y
**** could not convert string to float: test of wee_import text updates
**** Nothing done, exiting.

====== source file '/var/tmp/weewxaddnotes.csv' contents...

timestamp,extratemp1,extratemp2,ANComment
1645966620,11.0,11.5,test of wee_import text updates



On 05/03/2022, gjr80 <gjroder...@gmail.com> wrote:
> Glenn, could you try the attached weeimport.py, it should support text
> imports and be compatible with v4.5.1.
>
> Gary
>
> On Friday, 4 March 2022 at 14:51:33 UTC+10 gjr80 wrote:
>
>> Ah, didn't notice you were on 4.5.1. There was a change to units.py under
>>
>> 4.6.x that forced a change in weeimport.py, consequently the weeimport.py
>>
>> version I provided does not get on with WeeWX 4.5.x. Let me get you a
>> 4.5.x
>> compatible version.
>>
>> Gary
>>
>> On Friday, 4 March 2022 at 13:16:57 UTC+10 Glenn McKechnie wrote:
>>
>>> On 04/03/2022, gjr80 <gjrod...@gmail.com> wrote:
>>> > Glenn,
>>> >
>>> > Have you had a chance to try the revised wee_import? I am working on a
>>> > number of other changes to the same piece of wee_import code and I
>>> > would
>>> > prefer to do them all at once if possible.
>>>
>>> Whoops. Sorry about that. It slid down the Todo list a little too
>>> far. ie;- I got somewhat sidetracked.
>>>
>>> Re-visiting this and I find I've either forgotten something critical,
>>> or it just plain doesn't work...
>>>
>>> I'm stll using the weewx.451 installation where I was developing this.
>>> I've fetched and replaced weeimport/weeimport.py as per your
>>> instructions.
>>>
>>> sudo bin/wee_import --import-config=/home/weewx/csv.conf
>>> --config=/home/weewx/weewx.conf --verbose --dry-run
>>>
>>> and I get the following error (with dry-run and without) ...
>>>
>>> Using WeeWX configuration file /home/weewx/weewx.conf
>>> Starting wee_import...
>>> A CSV import from source file '/var/tmp/weewxaddnotes.csv' has been
>>> requested.
>>> The following options will be used:
>>> config=/home/weewx/weewx.conf, import-config=/home/weewx/csv.conf
>>> source=/var/tmp/weewxaddnotes.csv, from=None, to=None
>>> dry-run=True, calc_missing=True, ignore_invalid_data=True
>>> tranche=250, interval=conf, date/time_string_format=%Y-%m-%d %H:%M:%S
>>> delimiter=',', rain=cumulative, wind_direction=[-360.0, 360.0]
>>> UV=False, radiation=False
>>> Using database binding 'wx_binding', which is bound to database
>>> 'weewx.sdb'
>>> Destination table 'archive' unit system is '0x10' (METRIC).
>>> Missing derived observations will be calculated.
>>> All WeeWX UV fields will be set to None.
>>> All WeeWX radiation fields will be set to None.
>>> This is a dry run, imported data will not be saved to archive.
>>> Starting dry run import ...
>>> Obtaining raw import data for period 1 ...
>>> Traceback (most recent call last):
>>> File "bin/wee_import", line 899, in <module>
>>> main()
>>> File "bin/wee_import", line 829, in main
>>> source_obj.run()
>>> File "/home/weewx451/bin/weeimport/weeimport.py", line 372, in run
>>> _raw_data = self.getRawData(period)
>>> File "/home/weewx451/bin/weeimport/csvimport.py", line 246, in
>>> getRawData
>>> self.map = self.parseMap('CSV', _csv_reader, self.csv_config_dict)
>>> File "/home/weewx451/bin/weeimport/weeimport.py", line 635, in parseMap
>>> and _val['units'] not in weewx.units.USUnits.values() \
>>> AttributeError: 'ListOfDicts' object has no attribute 'values'
>>>
>>>
>>> The database field is named ANComment, the field I'm importing is
>>> named ANComment
>>>
>>> The attached files will show the full details. weewx.conf is unedited,
>>> it's a throw away installation.
>>>
>>> And, I've just cloned the wee_import_text branch - gives the same error.
>>>
>>> --
>>>
>>>
>>> Cheers
>>> Glenn
>>>
>>> rorpi - read only raspberry pi & various weewx addons
>>> https://github.com/glennmckechnie
>>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to weewx-user+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/030ad74a-557c-465f-a7c3-8d24a46b7773n%40googlegroups.com.
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAAraAziSr%3DFyyV8yPFjxNih7PSn5r_v9a%2BygBvjZDDrFmGFivA%40mail.gmail.com.

Reply via email to