Forum Replies Created
-
AuthorPosts
-
katie-birchardKeymaster
Hi David,
Thanks for your perseverance with this issue. It is definitely a strange one!
First, how did you look at your PATH variable? When viewing the PATH variable from the Windows Control Panel or printing out the results of running “path” in the command prompt, the “.” (dots) are not visible. They are only visible when calling os.environ[“PATH”] from a Python interpreter.
Second, you were able to import rasterio and pysyncrosim no problem from the Python interpreter because the issue only arises when running omniscape from the SyncroSim User Interface. This is because rasterio is looking for a GDAL DLL in all paths specified from running os.environ[“PATH”] in Python, and when running from the SyncroSim UI, the current directory (i.e., “.”) also contains a GDAL DLL. On import, rasterio enters all paths that contain a GDAL DLL into the os.add_dll_directory() function, including the “.”, which is invalid and results in the error you see here. When running from the Python interpreter, the current directory (i.e., “.”) does not contain a GDAL DLL, so all works as expected.
Cheers,
Katiekatie-birchardKeymasterHi David,
Version 1.0.19 of pysyncrosim is now available from conda-forge and PyPI. We’ve added two new arguments to the
save_datasheet()
method –append
andforce
. When saving a Project-scoped Datasheet, the default is forappend
to be set toTrue
, since overwriting this Datasheet can have consequences on Scenario-scoped Datasheets that reference Project-scoped Datasheet values. In order to overwrite a Project-scoped Datasheet, you must setappend
toFalse
andforce
toTrue
. This is the same functionality as thesaveDatasheet()
function inrsyncrosim
. You can also now delete information in a Datasheet by saving an empty DataFrame (withforce=True
for Project-scoped Datasheets).Hope this makes your modeling a bit easier!
Katie
katie-birchardKeymasterThere will be an example of an external program script using pysyncrosim forthcoming.
katie-birchardKeymasterHi David,
It looks like there is a bug in
save_datasheet()
. You should be able to overwrite the currently saved Datasheet and there should be no issue in saving an empty DataFrame as a Datasheet. We’ll fix these issues for the next release (v1.0.19) as well. Thanks for letting us know!Cheers,
Katiekatie-birchardKeymasterHi David,
Currently, the only way to add to existing Datasheets in pysyncrosim is to reload the Datasheet as a pandas DataFrame, concatenate with your new data, and then overwrite the old saved Datasheet (as you are doing in your example above). However, the next version of pysyncrosim (v1.0.19) will have a new
append
argument in thesave_datasheet()
method that will take advantage of the SyncroSim core software to efficiently append new data to existing Datasheets. The next version will become available early next week.Cheers,
Katiekatie-birchardKeymasterHi David,
The feature that you suggested in which you are able to determine which datasheets are “active” is now available in pysyncrosim. It follows the same idea as what was already implemented in rsyncrosim – in rsyncrosim, if you call
datasheet(myScenario, optional = TRUE)
, you will see a “data” column that contains “yes” or “no” for whether or not the datasheet contains data (i.e., is “active”). In the latest version of pysyncrosim we have added a similar feature, where if you callmyScenario.datasheets(optional=True)
you will find this same “data” column.You can now install the latest version of pysyncrosim from conda or PyPI following the instructions in the docs: https://pysyncrosim.readthedocs.io/en/latest/index.html
Thanks for the suggestion and let us know if you think of any other useful features!
katie-birchardKeymasterAnother thing to try if the above doesn’t work is a full online repair of Office 365. You can do this by navigating to “Programs and Features”, right-clicking on the “Microsoft 365” Application, and selecting “Change”. In the Microsoft pop-up box select the “Online Repair”, then click “Repair”.
katie-birchardKeymasterHi again,
In the “Turn Windows features on or off”, under the “.Net Framework 4.8 Advanced Services”, is there also a “WCF Services” box? If so, try selecting the “WCF Services” box, then select “TCP Port Sharing” below “WCF Services”.
Cheers,
Katiekatie-birchardKeymasterHello,
This error can occur when either Microsoft Excel is not installed, or the .Net programmability support is not enabled for Excel. If you have Excel installed, then you can follow these steps to enable the .Net programmability:
For Excel 2007:
1. Navigate to “Programs and Features” on your Windows machine (Control Panel > Programs > Programs and Features).
2. Open the Microsoft installer to modify Excel.
3. Make sure that “.Net Programmability Support” is checked, and click “Continue”.For Excel 365:
1. Navigate to “Programs and Features” on your Windows machine (Control Panel > Programs > Programs and Features).
2. Select “Turn windows features on/off”.
3. Within this window, select “.NET framework 4.8 Advanced Services”, and click “OK”.Please let us know if this does not resolve your issue.
Regards,
Katie -
AuthorPosts