Table of contents
- Running commands at a command prompt
- Install the Python interpreter
- Python package management
- Change log for Python G-Cubed
Throughout this documentation, you are instructed to run various commands at a prompt.
The prompt is available in a variety of forms, depending on the computer’s operating system.
On MacOS, access the prompt by runing the terminal application.
A prompt is accessible via the Terminal in MacOS. The Terminal enables commands to be run within a “shell”. Different shells are available on MacOS but recent versions of MacOS default to using the Z-shell,
On Windows, access the prompt by running
cmd or PowerShell. Some helpful links for Windows are provided below:
- How to access the command prompt
- How to use the command prompt
- How to access the Powershell
- Powershell cheatsheet
The Python interpreter is the software that runs Python programs.
The G-Cubed Python package requires you have a working Python interpreter installed on the computer. That Python interpreter must be version 3.10 or later.
TIP: Install the latest Python interpreter that is available.
Install Python 3.10+ on Windows from the Python site.
This involves the following steps.
- Select the latest Python 3 release
- Scroll down the page to the Files section
- Download the appropriate Windows installer for your computer 32 bit or 64 bit (probably not ARM).
- Double click on the installer to run the installation and accept the default settings.
Homebrew is a handy package manager for MacOS. It can be used to install the latest version of the Python interpreter. If you do not have
homebrew installed already, at the command prompt, run the single command specified on the homebrew homepage.
Once homebrew is installed, again from your command prompt, use it to install the latest Python version:
brew install python
Python itself cannot do too much, it needs all kinds of packages for all kinds of purposes.
G-Cubed uses this package system, distributing the G-Cubed model functionality as a Python package.
pip is a manager for Python’s packages. It helps you to install and remove packages. Packages that have been installed using pip are automatically discoverable by Python when they are imported into Python scripts.
pip may already be installed on your computer. To check, run the following command at the command prompt:
This should provide version details about pip and its associated Python interpreter. If not then you will need to install pip.
To install pip, follow the instructions on the pip official website. We recommend the method that uses your Python interpreter to run the
gcubed package is version 1.0.5, released on August 15, 2023
To install that package, download the binary gcubed package from McKibbin Software Group Pty. Limited. The file has a
whl filename extension.
To install the downloaded
gcubed Python package, run the following command in your terminal from within the directory that contains the downloaded file:
pip install gcubed-1.0.5-py3-none-any.whl
python -m pip install gcubed-1.0.5-py3-none-any.whl
You will need to uninstall and then reinstall the
gcubed package whenever there is a package update.
To do so, uninstall the old version of gcubed then install the newest version when you want to update
pip uninstall gcubed
python -m pip uninstall gcubed
Respond with a
Y to confirm the uninstall when asked.
To then install the updated version of the
pip install gcubed-<NEW_VERSION>-py3-none-any.whl
python -m pip install gcubed-<NEW_VERSION>-py3-none-any.whl
Added settings to the model configuration system to write and use a custom parameter calibration class.
Migrated the differences and deviations functionality from the Projections class to the gcubed.projections module. They are still accessible as class methods of the Projections class but that way of accessing them is deprecated and will be removed in future versions.
Improved the efficiency of the deviation calculations by vectorising most of the operations.
Added a new method (productivity_growth_rates_for_all_regions_and_sectors) to access productivity projections from the Productivity class.
Added new carbon coefficients for final demand for fossil fuels and for factor demand by each sector for each fossil fuel in each region.
Released on August 15, 2023.
ox_directory from the model configuration. The Ox directory is no longer required now that benchmarking against Ox results has been completed.
benchmarks_directory from the model configuration. The Benchmarks directory was only used for detailed reporting of any discrepancies between Ox results and Python results.
Removed logging system configuration from the Runner classes. Configuration of the logging system is now fully controlled by the user.
The ability for a runner to save baseline and final projections and the deviations between them to the results directory automatically has been deprecated. As part of this deprecation, the
results_directory properties of Runners now issue a warning whenever their values are changed.
gcubed.graphics.chart_pack app to use a simpler file format for defining chart packs. The chart pack app also now can be run using a simpler command:
python -m gcubed.graphics.charts
python -m gcubed.graphics.chart_pack command still works but it is deprecated and will be removed in a future release.
gcubed.graphics app. has been enhanced. It now supports the addition of a second series on the chart, so long as the units of the two series are identical.
Not released to the public.
Released on July 31, 2023.
Initial release of Python G-Cubed.