4.0.0b11: table archive_day_wind is not created anymore

92 views
Skip to first unread message

Bernhard R.

unread,
Feb 10, 2020, 1:33:41 PM2/10/20
to weewx-development
Hi there,

I guess, I stumbled over a regression somewhere between 4.0.0b6 and 4.0.0b11.

if I do
wee_database /etc/weewx/weewx.conf --drop-daily
and afterwards
wee_database /etc/weewx/weewx.conf --rebuild-daily

then table archive_day_wind is NOT created anymore when using weewx 4.0.0.b11
also letting weewx create the statistics upon start (after dropping them once again) will not create this table either.

However, the table still seems to be referenced by the included default skins, resulting in errors upon cheetahgenerator runs.

When I revert to version 4.0.0b6 and repeat the process, the table archive_day_wind is created just fine.

Is this intentional (and the skin templates need to be adjusted accodingly) or is this a regression?

anyways, Thanks for the great work done so far,

Bernhard :-)

Thomas Keffer

unread,
Feb 10, 2020, 5:52:09 PM2/10/20
to Bernhard R., weewx-development
Hmmm, I thought this was fixed in commit https://github.com/weewx/weewx/commit/ba096b752493134442b222c5c4fa4b49bcef1d84, now four months ago. Have you generated the new database using V4.0.0b11, or an earlier version, which, perhaps, contained the bug?

Also, can you take a look in your weewx.conf and see what type of schema you have? This will look something like:

[DataBindings]

    [[wx_binding]]
        ...
        # The schema defines the structure of the database.
        # It is *only* used when the database is created.
        schema = schemas.wview_extended.schema



--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/b245c089-33f8-45ac-bf5e-80f3ed62c75e%40googlegroups.com.

Bernhard R.

unread,
Feb 11, 2020, 11:28:50 AM2/11/20
to weewx-development
Hi Tom,

I redefined the schema in a user extension (user.sunduration) like this:
schema_with_sunshine_time = schemas.wview.schema + [('sunshine_time', 'REAL')] + [('sunshine_int', 'INTEGER')]

and use this schema in weewx.conf:
        # The schema defines the structure of the database.
        # It is *only* used when the database is created.
        ##### schema = schemas.wview_extended.schema
       
schema = user.sunduration.schema_with_sunshine_time

When I now naively try to redefine the extended schema (following the defaults) in my user extension like that

import schemas.wview_extended
schema_with_sunshine_time = schemas.wview_extended.schema + [('sunshine_time', 'REAL')] + [('sunshine_int', 'INTEGER')]

wee_database would fail with error:

TypeError: unsupported operand type(s) for +: 'dict' and 'list'


The database was initially created on v.3.9.1 and extended by 2 columns with wee_database under 4.0.0b6.

Does this narrow it down a bit, is there some additional info I can supply, to help tracinf this?

Thanks for all your efforts so far,

Bernhard :-)
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-de...@googlegroups.com.

Thomas Keffer

unread,
Feb 11, 2020, 11:36:52 AM2/11/20
to Bernhard R., weewx-development
V4.0 introduces a new way to specify a schema, although the old way is still supported.

The "wview" schema uses the old way. 

The "wview_extended" schema uses the new way. How to extend it is documented in the new version of the customizing guide. See the section "Adding a new type to the database". 

You used an old-style addition on the new-style schema wview_extended. That's why it didn't work.

But, you didn't answer my question. Did you create the new database using V4.0.0b11, or an earlier version, which, perhaps, contained the bug?

Cheers,

-tk


To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/e916b4b8-17dc-44e7-986c-d773cedf5183%40googlegroups.com.

Bernhard R.

unread,
Feb 11, 2020, 11:43:34 AM2/11/20
to weewx-development
Hi Tom,

The answer was ment to be the second last line of my previous message:

> The database was initially created on v.3.9.1 and extended by 2 columns with wee_database under 4.0.0b6.

Was this th information you were asking for?

I'll take a look at the new type of extension in the meantime...

Thanks a lot,

Bernhard :-)

PS: sorry for accidentially answering by email previously...

Thomas Keffer

unread,
Feb 11, 2020, 11:46:38 AM2/11/20
to Bernhard R., weewx-development
Sorry. I guess I need to rephrase that. Did you do the --rebuild-daily under the buggy version? Sounds like you did.

That would explain the "regression".

-tk

To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/6c91272a-0553-4c3d-bb88-73b85a001d76%40googlegroups.com.

Bernhard R.

unread,
Feb 11, 2020, 11:57:05 AM2/11/20
to weewx-development
Hi Tom,

the --rebuild-daily was done on 4.0.0b11 version and the table archive_day_wind is not recreated.

All others that are usually present are created as they should (including the ones for the custom fields), only wind is missing.

Thanks for your patience,

Bernhard :-)

Thomas Keffer

unread,
Feb 11, 2020, 12:42:46 PM2/11/20
to Bernhard R., weewx-development
Hmm, I'm unable to reproduce this. 

I created a schema "schema_with_sunshine_time", derived off the wview schema (NB: not wview_extended), then created the database. It had archive_day_wind

Then I dropped and rebuilt the daily summaries. Still has archive_day_wind.

This is using v4.0.0b12

-tk

To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/83aff808-6884-4563-b2b6-575254cc7f0a%40googlegroups.com.

Bernhard R.

unread,
Feb 11, 2020, 1:45:25 PM2/11/20
to weewx-development
Hi Tom,

must be some obscure quirks in my weewx.conf.

I did a lot of other tests, but finally, I used b12 with the unmodified b6 conf file (just adapting the version string) and archive_day_wind is created and filled again.

I'll now adapt the configs line by line and repeat the rebuild process after each change to find my error, but you are right (of course) it's not a regression in b11, it's a stupid user changing things in files he should have understood before doing so...

Anyways, thanks a lot for your help and sorry for wasting your time...

bernhard :-)

Bernhard R.

unread,
Feb 11, 2020, 2:04:36 PM2/11/20
to weewx-development
Found the culprit:

[DataBindings]

    [[wx_binding]]

         #manager = weewx.manager.DaySummaryManager           # does not recreate archive_day_wind
         manager = weewx.wxmanager.WXDaySummaryManager    # works! (archive_day_wind is created)

just in case someone else does similar things one day...

Thomas Keffer

unread,
Feb 11, 2020, 7:24:45 PM2/11/20
to Bernhard R., weewx-development
That's no different. You've always needed to specify WXDaySummaryManager to get a wind daily summary.

OK, now I feel better that we understand what happened.

-tk

To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/cab5d6e2-d434-454e-87d3-73aa82c9491c%40googlegroups.com.

Bernhard R.

unread,
Feb 12, 2020, 12:22:32 PM2/12/20
to weewx-development
Hi Tom,

correct, in this case, the error was located in fromt of the screen...

...surprisingly, you managed to solve this type of errors as well :-)

Thanks again,

bernhard :-)
Reply all
Reply to author
Forward
0 new messages