-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A/C data file #337
Comments
The source code links, e.g. https://github.com/JSBSim-Team/jsbsim/archive/v1.1.0.zip includes all the required data for the included aircraft etc. In addition to the |
Thanks Sean for clarifying the required directories Ok so it might make sense to update the |
The Yep, up until now we've pointed people to the source code zip file for aircraft data. If we did break out a separate I see the |
The
Indeed.
Yes and the
I agree it makes sense to have a dedicated zip file for data files. The workflow cpp-python-build.yml should be updated to produce a package of the data files that match the binaries & wheels release. I am also considering using Inno Setup to build a Windows installer that would contain the executables Inno Setup is an open source tool and is installed by default on GitHub servers. |
I have created #338 to address the README update whilst this is not critical. Thinking out loud, instead of creating a dedicated zip file one could think of adding the folders in the wheels directly using Providing a windows installer using InnoSetup is definitely a good idea and with lower again the effort to use |
I have considered that option but the data should be installed at a location where the user is able to retrieve them. Said in other words, where the wheel package should install the package ?
I guess that for a power user that develops his/her own aircraft or application the answer is yes. On the other hand, a new user will most likely download the aircraft data to practice with JSBSim.
No, for the same reason than wheel packages do not provide the aircraft data folders (i.e. where the data should be installed ?)
Yes and an additional benefit is that installers GUI allow user to select the path where the aircraft data will be installed. |
Yep the installer's GUI could also prompt the user to select what they would like to install, e.g.
In addition to where they would like to install each of them. |
As per the discussion in issue #337, this commit includes executables and aircraft data in the installer.
Since commit 9ddd718, we are providing a Windows installer As per @seanmcleod suggestion, users are prompted to install binaries and/or aircraft data. At the moment, the installer does not include the source code. I guess that at some point it will provide JSBSim headers and library rather than the whole source code. Indeed if one would want to install the complete source code I would rather expect that Please note that the MSVC C++ dll |
Each time a new stable version is released, the corresponding references in README.md must be updated. Manual update is error prone not considering that it might be overlooked by maintainers until someone opens an issue (see issue #337 and PR #338). This commit fixes that and automatically pushes changes to README.md to update all the references when a new stable release is built.
Each time a new stable version is released, the corresponding references in README.md must be updated. Manual update is error prone not considering that it might be overlooked by maintainers until someone opens an issue (see issue #337 and PR #338). This commit fixes that and automatically pushes changes to README.md to update all the references when a new stable release is built.
Just a heads up: I have just pushed the commit ac8fbe2 which automatically updates I realized by chance that I had forgotten to update these references for version 1.1.3 while I was updating the list of JSBSim users in Reminder to @JSBSim-Team: new releases are triggered by pushing a tag to the git repo. Our CI workflow then automatically builds all the packages/executables, updates the documentation and creates a new release. |
Default JSBSim aircraft data (including its engine and systems data) and scripts are now included in the Python wheels. The files are installed in the sys.prefix folder under share/JSBSim.
Default JSBSim aircraft data (including its engine and systems data) and scripts are now included in the Python wheels. The files are installed in the sys.prefix folder under share/JSBSim.
Starting from release If you declare the import jsbsim
fdm = jsbsim.FGFDMExec(None)
fdm.load_script('scripts/c1723.xml')
fdm.run_ic()
while fdm.run():
pass And the path to the aircraft data can easily be retrieved with: print(jsbsim.get_default_root_dir()) |
@bcoconni that'll be useful for quick easy setup. I know previously when I installed JSBSim into a cloud based Jupyter notebook it was a bit of a pain to get the JSBSim data into the virtual machine etc. Just tried it out with Google's Colab, but ran into an issue with the JSBSim data. Not clear if there is a permission issue and the |
Trying it locally on my Windows PC it worked. (base) C:\Users\Sean>pip install jsbsim
Collecting jsbsim
Downloading JSBSim-1.1.9-623-cp37-cp37m-win_amd64.whl (1.4 MB)
|████████████████████████████████| 1.4 MB 3.3 MB/s
Requirement already satisfied: numpy in c:\users\sean\anaconda3\lib\site-packages (from jsbsim) (1.18.1)
Installing collected packages: jsbsim
Successfully installed jsbsim-1.1.9
(base) C:\Users\Sean>python
Python 3.7.6 (default, Jan 8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import jsbsim
>>> print(jsbsim.get_default_root_dir())
C:\Users\Sean\anaconda3\share\JSBSim
>>> fdm = jsbsim.FGFDMExec(None)
JSBSim Flight Dynamics Model v1.1.9 [GitHub build 623/commit 56bb9b9cfbcd06d80afd682cea42b9d049488824] Nov 7 2021 18:44:16
[JSBSim-ML v2.0]
JSBSim startup beginning ... |
Semi-random observation/question. Why is the Linux wheel 23.9MB and the Windows wheel is only 1.4MB? |
This is most likely due to the fact that Linux wheels bundle almost all the libraries that the package depends on. This is by design since there are a lot of flavors of Linux distribution. Extract from the
|
The package seems to have been installed in |
It seems that the data files can also be installed in the folder contained in import site
print(site.USER_BASE) |
It is indeed in /usr/local/share
[image: image.png]
…On Thu, Nov 11, 2021 at 6:39 PM Bertrand Coconnier ***@***.***> wrote:
It seems that the data files can also be installed in the folder contained
in site.USER_BASE:
import site
print(site.USER_BASE)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#337 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAB7NPFY44E62KXNDSWORVTULP5TXANCNFSM4S3YBUHQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
--
Guillaume
https://calendly.com/guillaume-alleon
|
Right. So we need to autodetect that. From I could gather right now, the files can be located in either:
jsbsim/python/findInstallDir.py Lines 2 to 7 in d8bad12
Also of interest: StackOverflow "How do I find the location of my Python site-packages directory?" |
As reported in issue JSBSim-Team#337, the a/c data can be installed at a variety of location depending on the context of the installation (virtual envs, user install or global install). This fix parses the default folders that are likely to contain JSBSim a/c data.
This should now be the case since commit 5665833. |
The commit was roughly 15hrs ago, but it doesn't look like the python wheels have been updated and pushed yet? Just tried again on Google colab with a fresh |
No sorry, I have not triggered the wheels generation yet. I'd like someone to compile the wheels themselves and check that it works before triggering a release. |
I did test again on colab using
And everything went well on that platform |
Superb ! 👍 |
As reported in issue JSBSim-Team#337, the a/c data can be installed at a variety of location depending on the context of the installation (virtual envs, user install or global install). This fix parses the default folders that are likely to contain JSBSim a/c data.
JSBSim version If you can confirm that it works for you then I'd suggest to close this issue. |
Just tested One thing I did notice when running the script is that the .csv output file ends up in (base) C:\Users\Sean>dir .\anaconda3\share\JSBSim\ -recurse
Directory: C:\Users\Sean\anaconda3\share\JSBSim
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 11/12/2021 11:32 PM aircraft
-a---- 11/12/2021 11:30 PM 4182330 JSBout172B.csv
Directory: C:\Users\Sean\anaconda3\share\JSBSim\aircraft
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 11/12/2021 11:32 PM c172x
Directory: C:\Users\Sean\anaconda3\share\JSBSim\aircraft\c172x
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 11/12/2021 11:30 PM 694 initfile.133.441667.xml In general I guess you don't want an uninstall to delete any user generated data, just seems potentially messy leaving these output files around. |
When running the script `c1723.xml` with the Python wheel code, the `.csv` output file ends up in `share\JSBSim`, and doing a `pip uninstall jsbsim` doesn't clean them up. Following this commit, JSBSim has now a path to the directory where output files will be written. This path can therefore be different than the root directory. Two new methods ahve been added to the C++ class `FGFDMExec`: `SetOutputPath` and `GetOutputPath` (the corresponding Python methods are `set_output_path` and `get_output_path`). Regarding the Python wheel, the output path is set to the current directory (i.e. `$PWD`) when using the bundled a/c data. In all likelyhood this should be different than the root directory. The executable `JSBSim.exe` still uses the root directory as the output directory by default as it has always done.
Indeed. I pushed the commit 6203a00 that should fix that. Basically, the idea is to allow output files to be written at a different place than the aircraft data location. This is obtained by 2 new C++ methods With these 2 new methods, I could modify the Python wheels to write the output files at the current directory (i.e. Note that for some reason, |
I think I have found why the folders When uninstalling the package, I am suspecting an algorithm like below is executed:
Meaning that if the step 1 condition is not met, then the condition of step 2 is not evaluated. |
Folders without files are not deleted when the wheel package is uninstalled (see issue #337). Add `LICENSE.txt` to the root folder and `aircraft_template.xml` (warning: it is outdated) to `aircraft` for a proper removel of the JSBSim Python package.
When running the script `c1723.xml` with the Python wheel code, the `.csv` output file ends up in `share\JSBSim`, and doing a `pip uninstall jsbsim` doesn't clean them up. Following this commit, JSBSim has now a path to the directory where output files will be written. This path can therefore be different than the root directory. Two new methods ahve been added to the C++ class `FGFDMExec`: `SetOutputPath` and `GetOutputPath` (the corresponding Python methods are `set_output_path` and `get_output_path`). Regarding the Python wheel, the output path is set to the current directory (i.e. `$PWD`) when using the bundled a/c data. In all likelyhood this should be different than the root directory. The executable `JSBSim.exe` still uses the root directory as the output directory by default as it has always done.
Folders without files are not deleted when the wheel package is uninstalled (see issue #337). Add `LICENSE.txt` to the root folder and `aircraft_template.xml` (warning: it is outdated) to `aircraft` for a proper removel of the JSBSim Python package.
JSBSim should now clean up after itself after its Python package is uninstalled (commit 9b1b5cd). As I was suspecting, folders need to contain at least one package file for being deleted upon removal. So I took this opportunity to include the LGPL license Anyway, according to my tests, the inclusion of the 2 files mentioned above allows the proper removal of the whole folder |
Following the release of JSBSim |
Thanks a lot for creating wheels for mac, linux & windows platform. I will use them in
gym-jsbsim
.I have noticed that there is a new release since mid of October.
In order to be able to run the wheels, we need the data for the aircraft?
Would that make sense to create for each release a dedicated data asset file that would contain the files needed to run the wheels?
For the time being the README redirects to the Release Candidate (i.e. 1.0.0) not taking into account possible update and/or new file?
I can propose a PR if that if judged useful
BTW I would need to understand if the
aircraft
andengine
directories are the only one needed to operate existing a/c?thanks
Guillaume
The text was updated successfully, but these errors were encountered: