Skip to content
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

Make Python sample location more accessible #51

Closed
ischoegl opened this issue Jun 8, 2020 · 2 comments
Closed

Make Python sample location more accessible #51

ischoegl opened this issue Jun 8, 2020 · 2 comments
Labels
feature-request New feature request

Comments

@ischoegl
Copy link
Member

ischoegl commented Jun 8, 2020

Abstract

When compiling cantera from source, the python samples are not part of the sample folder; instead, they are part of the python package, which is oftentimes deep inside a folder structures. Merging Python samples with other samples will make access much more intuitive.

Motivation

This is the output of a current scons install on Win10 using Anaconda:

[...]
Cantera has been successfully installed.

File locations:

  applications                C:/Users/<user>/cantera\bin
  library files               C:/Users/<user>/cantera\lib
  C++ headers                 C:/Users/<user>/cantera\include
  samples                     C:/Users/<user>/cantera\samples
  data files                  C:/Users/<user>/cantera\data
  Python package (cantera)    C:\Users\<user>\anaconda3\envs\cantera-dev\Lib\site-packages
  Python samples              C:\Users\<user>\anaconda3\envs\cantera-dev\Lib\site-packages\cantera\examples
  Matlab toolbox              C:/Users/<user>/cantera\matlab\toolbox
  Matlab samples              C:/Users/<user>/cantera\samples\matlab

An m-file to set the correct matlab path for Cantera is at:

  C:/Users/<user>/cantera\matlab\toolbox\ctpath.m

scons: done building targets.

While the location of samples based on the prefix (C:/Users/<user>/cantera) is intuitive, getting to the Python example folder is unnecessarily involved.

  • What problem is it trying to solve? ... see above
  • Who is affected by the change? ... everyone compiling Cantera from source (20% of users per recent survey)
  • Why is this a good solution? ... all examples would be handled in a consistent fashion

Possible Solutions

The simplest solution would merge all examples into a single location as defined by scons's PREFIX using a slightly modified scons installer.

An alternative - potentially more robust - approach would be to make environment-specific examples stand-alone GitHub repositories. This would have the advantage of also addressing other installation options, especially those where installation paths use system-defined defaults. For those, it may make sense to not package examples, and have users download them from GitHub instead (i.e. similar to what is already done for Cantera/cantera-jupyter). When compiling from source, examples could still be automatically included as git subpackages. … see discussion in #129

Caveats

One sticking point of this discussion would be how to handle conda installations, where other examples are not included. Installation of examples with the toolbox is certainly the easiest approach, but the issue of cumbersome access remains. The alternative route of making examples a stand-alone repo would resolve this.

See also

#27

@ischoegl
Copy link
Member Author

While I just closed #129, I realized that one way that may cover concerns there is to leave examples in the main repo, but clone the examples folder to a dedicated repo after each merge. There are GH actions for this, e.g. this one

@ischoegl
Copy link
Member Author

ischoegl commented May 9, 2022

Closing - I am uncertain that there is support or need at this point.

@ischoegl ischoegl closed this as completed May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature request
Projects
None yet
Development

No branches or pull requests

1 participant