confusion with manager and schema

53 views
Skip to first unread message

RothMa

unread,
May 21, 2020, 11:51:56 AM5/21/20
to weewx-user
Hello,
i have installed the new stable version 4.0 in parallel (as described in the WIKI beta test) to test if my hardware and my own extensions work with python3.
I started with a new database and a new weewx.conf.
My old installation is weewx 3.9.1 (here the database and the weewx.conf was created with version 3.8.0).
During my tests with the new version I have now encountered a strange behaviour. Suddenly the database has lost the table "archive_daily_wind". On my search for the error I then came across this thread: https://groups.google.com/forum/m/#!topic/weewx-development/ODJ-VnkZS_0
With this thread I was able to research and reproduce the behaviour on my computer.
The database was created with the new weewx.conf here is used:
schema = schemas.wview_extended.schema
manager
= weewx.manager.DaySummaryManager

Afterwards I made my extension:
import schemas.wview

schema_with_sunshineHours
= schemas.wview.schema + [('sunshineHours', 'REAL')]

After changing the weewx.conf to "schema = user.sunshine.schema_with_sunshineHours" and a "wee_database --reconfigure" and "wee_database --rebuild-daily" the table "archive_daily_wind" was missing.

If I make the extension using the new schema:
import schemas.wview_extended
schema_with_sunshineHours = {
   
'table': schemas.wview_extended.table + [('sunshineHours', 'REAL')]
   
'day_summaries' : schemas.wview_extended.day_summaries + [('sunshineHours', 'SCALAR')]

and a "wee_database --reconfigure" and "wee_database --rebuild-daily" the table is not lost.
 
Obviously the schemas and managers are not interchangeable and interdependent. I am a bit confused now, which is probably the right setting.
 
My old installation uses
manager = weewx.wxmanager.WXDaySummaryManager
and an extended schema based on
schemas.wview

The new version 4.0 uses as default
manager = weewx.manager.DaySummaryManager
schema
= schemas.wview_extended.schema

In the documentation a third manager is also specified as default
weewx.wxmanager.DaySummaryManager
 
What are the differences between the managers?
Where are the differences between the two schemas?
Is there a documentation to read?
Which schema and which manager are recommended and how to update the database to Verion 4.0?
 
I look forward to your answers and thank you for the great program
Martin

Tom Keffer

unread,
May 21, 2020, 12:28:46 PM5/21/20
to weewx-user
You did some impressive digging, there!

There are now two different ways of specifying a schema. The old, V3.9 way, and a new V4.0 way. The new way is more flexible, although the old way is still supported.

The problem is that you're mixing methods. The old way used the superclass manager weewx.wxmanager.WXDaySummaryManager to add in the wind. The new way mentions it explicitly in the schema. 

Stick with one or the other and you'll be OK.

In any case, the database itself has not changed. If you just continue to use your "old" database, it will work fine in V4.0. The only thing that's changed is how to specify the schema for a brand new database.

Hope that helps.

-tk

--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/b1496823-2571-4320-aeee-53800a430036%40googlegroups.com.

RothMa

unread,
May 22, 2020, 5:48:35 AM5/22/20
to weewx-user
Hello,
thank you for the answer.
This helps, now it is quite simple and I can use my old database with the new manager and schema V4.0 (added according to the new method) without having to make any changes to the database.

Thank you very much and best regards

Martin
To unsubscribe from this group and stop receiving emails from it, send an email to weewx...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages