Closed WaltherTrgovac closed 2 months ago
@WaltherTrgovac could you please update the examples readme file? Specifically:
Now there is some problem with the reading of
.env.filip
. It seems like the variables will only be correctly loaded when the.env.filip
is put under the path of the examples, i.e.examples/ngsi_v2/
orexamples/basics/
@WaltherTrgovac could you have a look on that? If necessary you can modify thefilip/config.py
, where the variables are loaded
Wasn't it always like that? I think in the config of filip it says that the env file should be in the working directory, so it's up to the user to take care of that.
Now there is some problem with the reading of
.env.filip
. It seems like the variables will only be correctly loaded when the.env.filip
is put under the path of the examples, i.e.examples/ngsi_v2/
orexamples/basics/
@WaltherTrgovac could you have a look on that? If necessary you can modify thefilip/config.py
, where the variables are loaded
If I am understanding this correctly, the method SettingsConfigDict
in the class Settings
is taking the path of the .env.filip
file. It was set so that it is found only when the files to execute are in the same directory as the .env.filip
.
I have now adjusted that path so that the file can be located anywhere in the repository. I use the glob python package for that. First I locate the path of the repository with GitPython package and use that as the root directory. Then I look through the whole repository for the .env.filip
file. The problem is that the .env.filip
is a hidden file and glob package supports searching for hidden files only from the Python version 3.11... 😞. If somebody knows a solution for the earlier versions of Python that would be great.
And another thing, I have no idea how to test this implementation, I have just tested it manually...
If somebody knows a solution for the earlier versions of Python that would be great.
Never mind, I have changed it now
If somebody knows a solution for the earlier versions of Python that would be great.
Never mind, I have changed it now
Then to avoid confusion between multiple env files, we should probably remove the copy under basics. Or do you see another use for it?
Nice hint. No we don't need it any longer
Now only e6 cannot work, because the code regarding data model creation is not yet migrated to pydantic V2
Closes #237.
Current state of
examples\ngsiv2
that have been worked on:Before:![Before](https://github.com/RWTH-EBC/FiLiP/assets/39466610/120a974a-d270-4817-bb02-64bb77855852)
After:![after2](https://github.com/RWTH-EBC/FiLiP/assets/39466610/2ed5bd3f-d600-4018-bb30-1a21abd8416d)
Examples:
e01_ngsi_v2_context_basics.py
: working ✅ (last checked: 16.05.2024)e02_ngsi_v2_context_relationships.py
: working ✅ (last checked: 24.04.2024)e03_ngsi_v2_context_subscriptions_http.py
: working ✅ (last checked: 21.05.2024)e04_ngsi_v2_context_subscriptions_mqtt.py
: working ✅ (last checked: 21.05.2024)e05_ngsi_v2_context_registrations.py
: not completely working ⚠️ (last checked: 29.05.2024)e06_ngsi_v2_autogenerate_context_data_models.py
: not working ❌ (last checked: 30.04.2024)e07_ngsi_v2_iota_basics.py
: not completely working ⚠️ (last checked: 29.05.2024)2024-04-30 17:03:55,412 filip.clients.ngsi_v2.cb.ContextBrokerClient ERROR: Could not delete attribute 'on' of entity'sensor2' Reason: {"error":"NotFound","description":"The requested entity has not been found. Check type and id"}
e08_ngsi_v2_iota_paho_mqtt.py
: working ✅ (last checked: 11.06.2024)e09_ngsi_v2_iota_filip_mqtt.py
: working: ✅ (last checked: 12.06.2024)e10_ngsi_vs_quantumleap.py
: working ✅ (last checked: 07.05.2024)clear_all()
method at the start is causing this message from the logger:filip.clients.ngsi_v2.quantumleap.QuantumLeapClient ERROR: Could not load entity data
Reason: { "description": "No records were found for such query.", "error": "Not Found" }
This does not cause any negative impacts further in the code, but the output is not very clean.e11_ngsi_v2_context_specific_models.py
: working ✅ (last checked: 08.05.2024)e12_ngsi_v2_use_case_models.py
: working ✅ (last checked: 18.06.2024)TODO: The directories of the examples and the numeration of the examples has to be adjusted. For example, we have two examples with the number 11 in the
ngsiv2
directory, and the examples in thebasics
directory also need adjustment. README.md then also needs to be adjusted accordingly.