Metadata-Version: 2.4
Name: ebm
Version: 1.0.7
Summary: EBM is a bottom-up model that forecast estimates how area, energy need, heating systems and yearly energy use in the Norwegian building stock towards 2050
Author-email: ebm@nve.no, Lars Petrusson <lfep@nve.no>, Mohammed Ettyabi <moe@nve.no>, Ketil Nordstad <kenord@nve.no>
License-Expression: MIT
Project-URL: Homepage, https://www.nve.no/
Project-URL: Documentation, https://nve.github.io/ebm-docs
Project-URL: Repository, https://github.com/NVE/ebm.git
Keywords: building energy,building model,energy use buildings,energy need buildings,building area,area,building stock,energy forecast,area forecast,norwegian buildings
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Operating System :: OS Independent
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: loguru
Requires-Dist: numpy==2.2.6
Requires-Dist: openpyxl
Requires-Dist: pandas==2.2.3
Requires-Dist: python-dotenv
Requires-Dist: pandera==0.20.4
Requires-Dist: XlsxWriter
Requires-Dist: pywin32; platform_system == "Windows"
Requires-Dist: polars==1.31.0
Requires-Dist: pyarrow==20.0.0
Requires-Dist: azure-identity==1.23.0
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Provides-Extra: build
Requires-Dist: build; extra == "build"
Provides-Extra: dev
Requires-Dist: ebm[test]; extra == "dev"
Requires-Dist: ebm[build]; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: ruff-lsp; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: sphinx-rtd-theme; extra == "docs"
Requires-Dist: sphinx-autodoc-typehints; extra == "docs"
Requires-Dist: numpydoc; extra == "docs"
Requires-Dist: sphinx-tabs; extra == "docs"
Provides-Extra: tqdm
Requires-Dist: tqdm; extra == "tqdm"
Requires-Dist: XlsxWriter; extra == "tqdm"
Dynamic: license-file

#  Introduction 

EBM is a model used by the Norwegian Water Resources and Energy Directorates (NVE) to forecast energy use in the 
building stock. EBM is an open-source model developed and managed by NVE. The model allows the user to analyze how 
demographic trends and policy instruments impact the yearly energy use on a national and regional level. Energy use is 
estimated by a bottom- up approach, based on the building stock floor area, energy need and distribution of heating 
systems. The mathematical model is implemented in Python, with input and output files in Excel or CSV.


# Getting Started

## More information


 - [Full documentation found here](https://nve.github.io/ebm-docs/index.html)
   - [Model description](https://nve.github.io/ebm-docs/model_description/index.html)
   - [Limitations](https://nve.github.io/ebm-docs/limitations.html)
   - [User guide](https://nve.github.io/ebm-docs/user_guide/index.html)
   - [Troubleshooting](https://nve.github.io/ebm-docs/user_guide/troubleshooting.html)


## Setting up virtual environment
It is recommended that you use ebm in a python virtual environment (venv).

For detailed instructions, see
[How to create and activate a virtual environment](docs/source/env_setup.md)


## 1. Installation process 

<!-- Open a terminal application and navigate to wherever you want to do work. -->
 
<!-- Please refer to [getting started](https://nve.github.io/ebm-docs/user_guide/getting_started.html) for information on 
how ti install EBM as a user. -->

You can install the package in two main ways, depending on your needs:

**Option 1: Install from PyPI (recommended for most users)**

This is the simplest and most stable way to get the latest released version:

`python -m pip install ebm`


**Option 2: Install from source (for development or contributions)**

If you plan to modify the code or contribute to the project, clone the repository and install it in editable mode:

`git clone https://github.com/NVE/ebm`

`cd ebm`

Make sure your current working directory is the EBM root. 

`python -m pip install -e .`


The command will install install all dependencies and ebm as an editable module.
    
    
## 2. Software dependencies
  - pandas
  - loguru
  - openpyxl
  - pandera
   
  Dependecies will be automatically installed when you install the package as described under Installation process.
  See also [requirements.txt](requirements.txt)


## 3. Create an input directory
Before running the model you need to create a directory with the necessary input files:

`python -m ebm --create-input`



## 4. Run the model

There are multiple ways to run the program. Listed bellow is running as a standalone program and running as a module. If 
running as a program fails due to security restriction, you might be able to use the module approach instead. 

See also [Running as code](#running-as-code)


### Running as a module

```cmd
python -m ebm
```

By default, the results will be written to the subdirectory `output`

For more information use `--help`

`python -m ebm --help`

```shell
usage: ebm [-h] [--version] [--debug] [--categories [CATEGORIES ...]] [--input [INPUT]] [--force] [--open]
           [--csv-delimiter CSV_DELIMITER] [--create-input] [--horizontal-years]
           [{area-forecast,energy-requirements,heating-systems,energy-use}] [output_file]

Calculate EBM energy use 1.2.15

positional arguments:
  {area-forecast,energy-requirements,heating-systems,energy-use}

                        The calculation step you want to run. The steps are sequential. Any prerequisite to the chosen step will run
                            automatically.
  output_file           The location of the file you want to be written. default: output\ebm_output.xlsx
                            If the file already exists the program will terminate without overwriting.
                            Use "-" to output to the console instead

options:
  -h, --help            show this help message and exit
  --version, -v         show program's version number and exit
  --debug               Run in debug mode. (Extra information written to stdout)
  --categories [CATEGORIES ...], --building-categories [CATEGORIES ...], -c [CATEGORIES ...]

                        One or more of the following building categories:
                            house, apartment_block, kindergarten, school, university, office, retail, hotel, hospital, nursing_home, culture, sports, storage_repairs.
                            The default is to use all categories.
  --input [INPUT], --input-directory [INPUT], -i [INPUT]
                        path to the directory with input files
  --force, -f           Write to <filename> even if it already exists
  --open, -o            Open output file(s) automatically when finished writing. (Usually Excel)
  --csv-delimiter CSV_DELIMITER, --delimiter CSV_DELIMITER, -e CSV_DELIMITER
                        A single character to be used for separating columns when writing csv. Default: "," Special characters like ; should be quoted ";"
  --create-input
                        Create input directory containing all required files in the current working directory
  --horizontal-years, --horizontal, --horisontal
                        Show years horizontal (left to right)
```


### Running as code
```python

from ebm.temp_calc import calculate_energy_use_wide
from ebm.model.file_handler import FileHandler

fh = FileHandler()
fh.create_missing_input_files()

df = calculate_energy_use_wide(ebm_input=fh.input_directory)
print(df)

```

## License
This project is licensed under the MIT License. You are free to use, modify, and distribute the software with proper attribution.

## Contributing
We welcome contributions! Please refer to the [Contributing Guide](CONTRIBUTING.md) for details on how to get started.

## Documentation
Full documentation is available at the EBM User Guide: https://nve.github.io/ebm-docs/



