### Run structure-creator example Source: https://github.com/ncbj-idea/pyzefir/blob/main/docs/installation.rst Executes the structure-creator command with example input, output, scenario, and time period parameters. ```console structure-creator -i pyzefir\resources\structure_creator_resources -o pyzefir\results -s base_scenario -h 8760 -y 20 ``` -------------------------------- ### Install Dependencies with Make Source: https://github.com/ncbj-idea/pyzefir/blob/main/README.md Uses the project's Makefile to create a virtual environment and install all required dependencies. ```bash make install ``` -------------------------------- ### Run Structure Creator Example Source: https://github.com/ncbj-idea/pyzefir/blob/main/README.md Executes the 'structure-creator' tool with example parameters specifying input/output paths, scenario name, and time/year constants. ```bash structure-creator -i pyzefir\resources\structure_creator_resources -o pyzefir\results -s base_scenario -h 8760 -y 20 ``` -------------------------------- ### Install pyzefir using make Source: https://github.com/ncbj-idea/pyzefir/blob/main/docs/installation.rst Uses the Makefile to install the pyzefir project and its dependencies, typically into a virtual environment. ```bash make install ``` -------------------------------- ### Install Make on Debian/Ubuntu Source: https://github.com/ncbj-idea/pyzefir/blob/main/README.md Installs the 'make' utility using the apt package manager, typically on Debian or Ubuntu Linux distributions. ```bash sudo apt install make ``` -------------------------------- ### Manually set up development environment Source: https://github.com/ncbj-idea/pyzefir/blob/main/docs/installation.rst Creates and activates a Python virtual environment, installs the project and development dependencies, and initializes the pre-commit hook manually. ```bash # create and source virtual environment python -m venv .venv source .venv/bin/activate # install all requirements and dependencies pip install . pip install .[dev] # init pre-commit hook pre-commit install ``` -------------------------------- ### Install pyzefir using pip Source: https://github.com/ncbj-idea/pyzefir/blob/main/docs/installation.rst Installs the pyzefir package from the global pip index. ```bash pip install pyzefir ``` -------------------------------- ### Example PyZefir Configuration File (.ini) Source: https://github.com/ncbj-idea/pyzefir/blob/main/docs/input_data.rst Provides an example of the .ini configuration file used to run PyZefir, detailing sections for input, output, parameters, and optimization settings. ```none [input] input_path = path to input files input_format = xlsx scenario = scenario name [output] output_path = path to results directory sol_dump_path = path where to save *.sol file opt_logs_path = path where to save gurobi log file csv_dump_path = path where to save csv files (xlsx->csv conversion result) [parameters] hour_sample = path *.csv file containing hour_sample vector year_sample = path *.csv file containing year_sample vector discount_rate = path *.csv file containing discount_rate vector [optimization] binary_fraction = true if fraction have to be treated as binary, otherwise false ``` -------------------------------- ### Install make on Debian/Ubuntu Source: https://github.com/ncbj-idea/pyzefir/blob/main/docs/installation.rst Installs the make utility using the apt package manager on Debian or Ubuntu systems. Requires superuser privileges. ```bash sudo apt install make ``` -------------------------------- ### Install PyZefir via pip Source: https://github.com/ncbj-idea/pyzefir/blob/main/README.md Installs the PyZefir package from the global Python Package Index (PyPI) using pip. ```bash pip install pyzefir ``` -------------------------------- ### Install Project in Virtual Environment Manually Source: https://github.com/ncbj-idea/pyzefir/blob/main/README.md Installs the current project package into the active virtual environment using pip. ```bash pip install . ``` -------------------------------- ### Display pyzefir command help Source: https://github.com/ncbj-idea/pyzefir/blob/main/docs/installation.rst Shows the command-line options available for the pyzefir executable. ```console pyzefir --help Options: -c, --config PATH Path to *.ini file. [required] -hcd, --hash-commit-dump Flag to include hash commit information. (only in development mode) --help Show this message and exit. ``` -------------------------------- ### Display structure-creator command help Source: https://github.com/ncbj-idea/pyzefir/blob/main/docs/installation.rst Shows the command-line options available for the structure-creator executable. ```console structure-creator --help Usage: structure-creator [OPTIONS] Options: -i, --input_path PATH Input data for the creator. [required] -o, --output_path PATH Path to dump the results. [required] -s, --scenario_name TEXT Name of the scenario. [required] -h, --n_hours INTEGER N_HOURS constant. -y, --n_years INTEGER N_YEARS constant. --help Show this message and exit. ``` -------------------------------- ### Install pyzefir editable with make Source: https://github.com/ncbj-idea/pyzefir/blob/main/docs/installation.rst Installs the pyzefir project in editable mode using the Makefile, allowing source code changes to be reflected immediately. ```bash make install EDITABLE=yes ``` -------------------------------- ### Initializing Network Constants and Network (Python) Source: https://github.com/ncbj-idea/pyzefir/blob/main/docs/quick_start.rst Initializes the NetworkConstants object with global parameters like simulation duration and emission limits. Then initializes the main Network object, linking it to the constants and specifying the energy types to be modeled. ```python network_constants = NetworkConstants( n_years=5, n_hours=8760, relative_emission_limits={'r_emission_limit_0': pd.Series([1, 2])}, base_total_emission={'b_total_emission_0': 1}, power_reserves={'p_reserve_0': {'reserve_1': 1}} ) network = Network( network_constants=network_constants, energy_types=['ELECTRICITY_END'] ) ``` -------------------------------- ### Run pyzefir with basic config Source: https://github.com/ncbj-idea/pyzefir/blob/main/docs/installation.rst Executes the pyzefir command using a specified configuration file. ```bash pyzefir -c pyzefir/config_basic.ini ``` -------------------------------- ### Run pyzefir with hash dump (dev mode) Source: https://github.com/ncbj-idea/pyzefir/blob/main/docs/installation.rst Executes the pyzefir command with a configuration file and includes commit hash information, available only in development mode installation. ```console pyzefir -c pyzefir/config_basic.ini --hash-commit-dump ``` -------------------------------- ### Install Project with Development Dependencies Manually Source: https://github.com/ncbj-idea/pyzefir/blob/main/README.md Installs the current project package along with its development-specific dependencies into the active virtual environment using pip. ```bash pip install .[dev] ``` -------------------------------- ### Run PyZefir Simulation Source: https://github.com/ncbj-idea/pyzefir/blob/main/README.md Starts the PyZefir simulation process using the configuration specified in the provided INI file. ```bash pyzefir -c pyzefir/config_basic.ini ``` -------------------------------- ### Check make version Source: https://github.com/ncbj-idea/pyzefir/blob/main/docs/installation.rst Verifies if the make utility is installed on the system and displays its version. ```bash make --version ``` -------------------------------- ### Importing Libraries (Python) Source: https://github.com/ncbj-idea/pyzefir/blob/main/docs/quick_start.rst Imports the pandas library for data manipulation and key classes (Network, NetworkConstants) from the pyzefir library required for building the energy model. ```python import pandas as pd from pyzefir.model.network import Network from pyzefir.model.utils import NetworkConstants ``` -------------------------------- ### Initialize Pre-commit Hooks Manually Source: https://github.com/ncbj-idea/pyzefir/blob/main/README.md Installs the pre-commit hooks configured for the project, automating code checks before commits are finalized. ```bash pre-commit install ``` -------------------------------- ### Run PyZefir Simulation with Commit Hash Dump Source: https://github.com/ncbj-idea/pyzefir/blob/main/README.md Starts the PyZefir simulation using the specified configuration file and includes the git commit hash information in the output, typically used in development. ```bash pyzefir -c pyzefir/config_basic.ini --hash-commit-dump ``` -------------------------------- ### Install Dependencies in Editable Mode Source: https://github.com/ncbj-idea/pyzefir/blob/main/README.md Uses the Makefile to install project dependencies in editable mode, allowing code changes to be reflected without reinstallation, useful for development. ```bash make install EDITABLE=yes ``` -------------------------------- ### Run integration tests with make Source: https://github.com/ncbj-idea/pyzefir/blob/main/docs/installation.rst Executes full integration tests using the Makefile. This target also runs the lint and unit stages. ```bash make test ``` -------------------------------- ### Check Make Version Source: https://github.com/ncbj-idea/pyzefir/blob/main/README.md Checks if the 'make' utility is installed on the system and displays its version information. ```bash make --version ``` -------------------------------- ### Run unit tests with make Source: https://github.com/ncbj-idea/pyzefir/blob/main/docs/installation.rst Executes unit and fast integration tests using the Makefile. This target also runs the lint stage. ```bash make unit ``` -------------------------------- ### Run linters with make Source: https://github.com/ncbj-idea/pyzefir/blob/main/docs/installation.rst Executes the linting stage defined in the Makefile to check code against PEP standards. ```bash make lint ``` -------------------------------- ### Adding Buses and Lines to Network (Python) Source: https://github.com/ncbj-idea/pyzefir/blob/main/docs/quick_start.rst Adds two energy buses ('bus_0', 'bus_1') of type 'ELECTRICITY_END' to the network. Subsequently, adds a transmission line connecting these two buses, specifying its name, endpoints, transmission loss, and maximum capacity. ```python # create 2 buses network.add_bus(name='bus_0', energy_type='ELECTRICITY_END') network.add_bus(name='bus_1', energy_type='ELECTRICITY_END') # attach a line connecting the buses network.add_line( name='e_end_line', fr='bus_0', to='bus_1', transmission_loss=0.1, max_capacity=10000 ) ``` -------------------------------- ### Clean project files with make Source: https://github.com/ncbj-idea/pyzefir/blob/main/docs/installation.rst Removes temporary files and directories like virtual environments and cache directories using the Makefile. ```bash make clean ``` -------------------------------- ### Activate Python Virtual Environment Manually Source: https://github.com/ncbj-idea/pyzefir/blob/main/README.md Activates the previously created virtual environment, making its Python interpreter and installed packages available in the current shell session. ```bash source .venv/bin/active ``` -------------------------------- ### Adding Generator Instance to Bus (Python) Source: https://github.com/ncbj-idea/pyzefir/blob/main/docs/quick_start.rst Adds a specific generator instance ('generator_0') of the previously defined 'solar' type to 'bus_0'. Configures unit-specific parameters such as base capacity and minimum/maximum capacity constraints for the individual generator unit. ```python # add generator to bus_0 network.add_generator( name='generator_0', energy_source_type='solar', bus='bus_0' unit_base_cap=5, unit_min_capacity=pd.Series([1, 2]), Unit_max_capacity=pd.Series([5, 10]), unit_min_capacity_increase=pd.Series([1, 1]), unit_max_capacity_increase=pd.Series([1, 1]) ) ``` -------------------------------- ### Defining Generator Type (Python) Source: https://github.com/ncbj-idea/pyzefir/blob/main/docs/quick_start.rst Defines a new type of energy source ('solar') within the network model. This includes specifying its associated energy types, emission reduction factors, power utilization profiles, lifetime, build time, cost parameters (CAPEX, OPEX), and capacity constraints. ```python # add generator type to the network network.add_generator_type( name='solar', energy_types=('ELECTRICITY_END'), emission_reduction={'e_reduction': pd.Series([1, 1])}, power_utilization=pd.Series([5, 5]), minimal_power_utilization=pd.Series([1, 1]), life_time=10, build_time=1, capex=pd.Series([10, 10]), opex=pd.Series([1, 1]), min_capacity=pd.Series([1, 1]), max_capacity=pd.Series([10, 10]), min_capacity_increase=pd.Series([1, 2]), max_capacity_increase=pd.Series([5, 5]) ) ``` -------------------------------- ### Show PyZefir Help Source: https://github.com/ncbj-idea/pyzefir/blob/main/README.md Displays the command-line options and usage information for the main 'pyzefir' simulation execution tool. ```bash pyzefir --help ``` -------------------------------- ### Show Structure Creator Help Source: https://github.com/ncbj-idea/pyzefir/blob/main/README.md Displays the command-line options and usage information for the 'structure-creator' tool, which is used to prepare input data. ```bash structure-creator --help ``` -------------------------------- ### Run Unit Tests with Make Source: https://github.com/ncbj-idea/pyzefir/blob/main/README.md Executes unit and fast integration tests using the Makefile. This stage typically runs the lint stage beforehand. ```bash Make unit ``` -------------------------------- ### Run Integration Tests with Make Source: https://github.com/ncbj-idea/pyzefir/blob/main/README.md Executes integration tests using the Makefile. This stage typically runs the lint and unit stages beforehand. ```bash make test ``` -------------------------------- ### Structure Creator Resources Directory Structure Source: https://github.com/ncbj-idea/pyzefir/blob/main/docs/input_data.rst Illustrates the expected directory structure for the structure creator's resources, including subdirectories for LBS and scenarios, and various configuration files. ```none . └── structure_creator_resources/ ├── lbs/ │ ├── boiler_coal_new_lkt.xlsx │ ├── boiler_gas_lkt.xlsx │ └── ... ├── scenarios/ │ └── base_scenario/ │ ├── fractions/ │ │ ├── boiler_coal_new_lkt.xlsx │ │ ├── boiler_gas_lkt.xlsx │ │ └── ... │ ├── cost_parameters.xlsx │ ├── fuel_parameters.xlsx │ ├── generation_fraction.xlsx │ ├── n_consumers.xlsx │ ├── relative_emission_limits.xlsx │ ├── technology_cap_limits.xlsx │ ├── technology_type_cap_limits.xlsx │ └── yearly_demand.xlsx ├── aggregates.xlsx ├── configuration.xlsx ├── emissions.xlsx ├── subsystems.xlsx └── transmission_fees.xlsx ``` -------------------------------- ### Create Python Virtual Environment Manually Source: https://github.com/ncbj-idea/pyzefir/blob/main/README.md Manually creates a new Python virtual environment named '.venv' in the current directory using the venv module. ```bash python -m venv .venv ``` -------------------------------- ### PyZefir Resources Directory Structure (XLSX and CSV) Source: https://github.com/ncbj-idea/pyzefir/blob/main/docs/input_data.rst Shows the required directory structure for PyZefir resources, detailing the layout for both XLSX and CSV input formats, including scenario directories and various data files. ```none XLSX input . └── /pyzefir resources/ ├── /scenarios/ │ ├── scenario_1.xlsx │ ├── scenario_2.xlsx │ └── ... ├── capacity_factors.xlsx ├── conversion_rate.xlsx ├── demand_chunks.xlsx ├── fuels.xlsx ├── generator_types.xlsx ├── initial_state.xlsx ├── storage_types.xlsx └── structure.xlsx CSV input . └── /pyzefir resources/ ├── /capacity_factors/ │ └── Profiles.csv ├── /conversion_rate/ │ ├── HEAT_PUMP.csv │ ├── BOILER_COAL.csv │ └── ... ├── /demand_chunks/ │ ├── Demand_Chunks.csv │ ├── chunk_period_1.csv │ ├── chunk_period_2.csv │ └── ... ├── /demand_types/ │ ├── family.csv │ ├── multifamily.csv │ └── ... ├── /fuels/ │ ├── Emission_Per_Unit.csv │ └── Energy_Per_Unit.csv ├── /generator_types/ │ ├── Efficiency.csv │ ├── Emission_Reduction.csv │ ├── Generator_Type_Energy_Carrier.csv │ ├── Generator_Type_Energy_Type.csv │ ├── Generator_Types.csv │ └── Power_Utilization.csv ├── /initial_state/ │ ├── Technology.csv │ └── TechnologyStack.csv ├── /storage_types/ │ └── Parameters.csv ├── /structure/ │ ├── Aggregates.csv │ ├── Buses.csv │ ├── DSR.csv │ ├── Emission_Fees_Emission_Types.csv │ ├── Emission_Types.csv │ ├── Energy_Types.csv │ ├── Generator_Binding.csv │ ├── Generator_Emission_Fees.csv │ ├── Generators.csv │ ├── Lines.csv │ ├── Power_Reserve.csv │ ├── Storages.csv │ ├── Technology_Bus.csv │ ├── TechnologyStack_Aggregate.csv │ ├── TechnologyStack_Buses_out.csv │ ├── TechnologyStack_Buses.csv │ └── Transmission_Fees.csv └── /scenario/ ├── /scenario_name/ │ ├── Constants.csv │ ├── Cost_Parameters.csv │ ├── Curtailment_Cost.csv │ ├── Element_Energy_Evolution_Limits.csv │ ├── Emission_Fees.csv │ ├── Energy_Source_Evolution_Limits.csv │ ├── Fractions.csv │ ├── Fuel_Availability.csv │ ├── Fuel_Prices.csv │ ├── Generation_Fraction.csv │ ├── N_Consumers.csv │ ├── Relative_Emission_Limits.csv │ └── Yearly_Demand.csv └── /another_scenario_name/ └── .... ``` -------------------------------- ### Run Linters with Make Source: https://github.com/ncbj-idea/pyzefir/blob/main/README.md Executes code linters (like black and pylama) configured in the Makefile to check code style and quality. ```bash make lint ``` -------------------------------- ### Clean Project Files with Make Source: https://github.com/ncbj-idea/pyzefir/blob/main/README.md Removes temporary files and directories, such as the virtual environment (.venv) and cache directories, as defined in the Makefile. ```bash make clean ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.