Skip to content

Commit ef37872

Browse files
committed
Init of open-sourced version
0 parents  commit ef37872

File tree

2,000 files changed

+343215
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,000 files changed

+343215
-0
lines changed

.dockerignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules
2+
npm-debug.log
3+
Dockerfile*
4+
docker-compose*
5+
.dockerignore
6+
.git
7+
.gitignore
8+
README.md
9+
LICENSE
10+
.vscode

.gitignore

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# IDE
10+
.idea/
11+
.vscode/
12+
.settings
13+
.project
14+
.buildpath
15+
16+
# Distribution / packaging
17+
.Python
18+
build/
19+
develop-eggs/
20+
dist/
21+
downloads/
22+
eggs/
23+
.eggs/
24+
lib/
25+
lib64/
26+
parts/
27+
sdist/
28+
var/
29+
wheels/
30+
share/python-wheels/
31+
*.egg-info/
32+
.installed.cfg
33+
*.egg
34+
MANIFEST
35+
36+
# PyInstaller
37+
# Usually these files are written by a python script from a template
38+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
39+
*.manifest
40+
*.spec
41+
42+
# Installer logs
43+
pip-log.txt
44+
pip-delete-this-directory.txt
45+
46+
# Unit test / coverage reports
47+
htmlcov/
48+
.tox/
49+
.nox/
50+
.coverage
51+
.coverage.*
52+
.cache
53+
nosetests.xml
54+
coverage.xml
55+
*.cover
56+
*.py,cover
57+
.hypothesis/
58+
.pytest_cache/
59+
cover/
60+
61+
# Translations
62+
*.mo
63+
*.pot
64+
65+
# Django stuff:
66+
*.log
67+
local_settings.py
68+
*.sqlite3
69+
db.sqlite3
70+
db.sqlite3-journal
71+
72+
# Flask stuff:
73+
instance/
74+
.webassets-cache
75+
76+
# Scrapy stuff:
77+
.scrapy
78+
79+
# Sphinx documentation
80+
docs/_build/
81+
82+
# PyBuilder
83+
.pybuilder/
84+
target/
85+
86+
# Jupyter Notebook
87+
.ipynb_checkpoints
88+
89+
# IPython
90+
profile_default/
91+
ipython_config.py
92+
93+
# pyenv
94+
# For a library or package, you might want to ignore these files since the code is
95+
# intended to run in multiple environments; otherwise, check them in:
96+
# .python-version
97+
98+
# pipenv
99+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
100+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
101+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
102+
# install all needed dependencies.
103+
#Pipfile.lock
104+
105+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
106+
__pypackages__/
107+
108+
# Celery stuff
109+
celerybeat-schedule
110+
celerybeat.pid
111+
112+
# SageMath parsed files
113+
*.sage.py
114+
115+
# Environments
116+
.env
117+
.env.*
118+
.venv
119+
.envs/
120+
env/
121+
venv/
122+
ENV/
123+
env.bak/
124+
venv.bak/
125+
126+
# Spyder project settings
127+
.spyderproject
128+
.spyproject
129+
130+
# Rope project settings
131+
.ropeproject
132+
133+
# mkdocs documentation
134+
/site
135+
136+
# mypy
137+
.mypy_cache/
138+
.dmypy.json
139+
dmypy.json
140+
141+
# Pyre type checker
142+
.pyre/
143+
144+
# pytype static type analyzer
145+
.pytype/
146+
147+
# Cython debug symbols
148+
cython_debug/
149+
150+
# data
151+
staticfiles/
152+
postgres/data/
153+
user_files/
154+
155+
# OS generated files
156+
.DS_Store
157+
.DS_Store?
158+
._*
159+
.Spotlight-V100
160+
.Trashes
161+
Thumbs.db
162+
163+
# Sample data
164+
data/*
165+
data/timeseries/*
166+
!data/timeseries/
167+
!data/timeseries/4de803f7-1d36-4155-8cdb-9dc52946b6b7.csv
168+
!data/timeseries/50fa074e-9279-4b3f-bead-7762fe1643f3.csv
169+
!data/timeseries/141a6e6c-e47f-4363-85ed-8d40b525ac77.csv
170+
!data/timeseries/f97df022-1dc7-4f59-bb15-3e0d94f4ba9d.csv
171+
!data/timeseries/dac8030c-c9b5-48db-8550-cc78312ddabb.csv

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# NREL Engage: A [Calliope](https://github.com/calliope-project/calliope) Web Environment for Collaborative Energy Systems Modeling and Planning
2+
3+
Engage is a free, open-access energy system planning tool that allows multiple users/stakeholders to develop and collaborate on capacity expansion models. The tool, developed at the National Renewable Energy Laboratory (NREL), provides a collaborative and easy-to-use interface built on Calliope, a multi-scale energy systems modeling framework.
4+
5+
- Visit the NREL hosted webtool at https://engage.nrel.gov/
6+
7+
8+
## Requirements
9+
- Docker (https://www.docker.com/get-started)
10+
- Docker Compose (e.g. ```brew install docker-compose```)
11+
12+
13+
## Development
14+
15+
Please refer to the documentation to setup development environment,
16+
17+
https://nrel.github.io/engage/index.html
18+
19+
and the developer guide to contribute to Enage project.
20+
21+
## License
22+
Add license to this repo.

calliope_app/__init__.py

Whitespace-only changes.

calliope_app/__version__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "0.1.0"

calliope_app/api/__init__.py

Whitespace-only changes.

calliope_app/api/admin.py

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
from django.contrib import admin
2+
3+
from api.models.engage import Help_Guide, User_Profile
4+
from api.models.calliope import Abstract_Tech, Abstract_Tech_Param, \
5+
Parameter, Run_Parameter
6+
from api.models.configuration import Model, Model_User, Model_Comment, \
7+
Location, Technology, Tech_Param, Model_Favorite, User_File, \
8+
Loc_Tech, Loc_Tech_Param, Timeseries_Meta, Scenario, \
9+
Scenario_Loc_Tech, Scenario_Param
10+
from api.models.outputs import Run
11+
12+
13+
class Help_Guide_Admin(admin.ModelAdmin):
14+
# fields = []
15+
list_display = ['key', 'safe_html']
16+
17+
18+
class Parameter_Admin(admin.ModelAdmin):
19+
# fields = []
20+
list_display = ['id', 'root', 'category', 'name', 'pretty_name',
21+
'description', 'timeseries_enabled', 'units', 'choices',
22+
'is_linear', 'is_expansion', 'is_systemwide',
23+
'is_essential', 'is_carrier']
24+
25+
26+
class Abstract_Tech_Admin(admin.ModelAdmin):
27+
list_display = ['id', 'name', 'pretty_name', 'image',
28+
'description', 'icon']
29+
30+
31+
class Abstract_Tech_Param_Admin(admin.ModelAdmin):
32+
list_display = ['id', 'abstract_tech', 'parameter', 'default_value']
33+
34+
35+
class Model_Admin(admin.ModelAdmin):
36+
list_display = ['id', 'name', 'snapshot_version', 'snapshot_base',
37+
'power_units', 'temporal_resolution', 'uuid',
38+
'public', 'created', 'updated']
39+
40+
41+
class Model_User_Admin(admin.ModelAdmin):
42+
list_display = ['id', 'model', 'user', 'can_edit',
43+
'last_access', 'notifications']
44+
45+
46+
class User_Profile_Admin(admin.ModelAdmin):
47+
list_display = ['id', 'user', 'organization',
48+
'timezone', 'activation_uuid']
49+
50+
51+
class Model_Comment_Admin(admin.ModelAdmin):
52+
list_display = ['id', 'model', 'user', 'type', 'comment', 'created']
53+
54+
55+
class Model_Favorite_Admin(admin.ModelAdmin):
56+
list_display = ['id', 'model', 'parameter']
57+
58+
59+
class User_File_Admin(admin.ModelAdmin):
60+
list_display = ['id', 'filename', 'description', 'model', 'created']
61+
62+
63+
class Run_Parameter_Admin(admin.ModelAdmin):
64+
list_display = ['id', 'root', 'name', 'pretty_name', 'description',
65+
'user_visibility', 'can_evolve',
66+
'default_value', 'choices']
67+
68+
69+
class Location_Admin(admin.ModelAdmin):
70+
list_display = ['id', 'pretty_name', 'name', 'latitude', 'longitude',
71+
'available_area', 'model', 'created', 'updated']
72+
73+
74+
class Technology_Admin(admin.ModelAdmin):
75+
list_display = ['id', 'pretty_name', 'abstract_tech', 'name', 'tag',
76+
'pretty_tag', 'is_linear', 'is_expansion', 'model',
77+
'created', 'updated']
78+
79+
80+
class Tech_Param_Admin(admin.ModelAdmin):
81+
list_display = ['id', 'technology', 'year', 'parameter', 'value',
82+
'timeseries', 'timeseries_meta', 'model',
83+
'created', 'updated']
84+
85+
86+
class Loc_Tech_Admin(admin.ModelAdmin):
87+
list_display = ['id', 'location_1', 'location_2', 'technology',
88+
'model', 'created', 'updated']
89+
90+
91+
class Loc_Tech_Param_Admin(admin.ModelAdmin):
92+
list_display = ['id', 'loc_tech', 'year', 'parameter', 'value',
93+
'timeseries', 'timeseries_meta', 'model',
94+
'created', 'updated']
95+
96+
97+
class Timeseries_Meta_Admin(admin.ModelAdmin):
98+
list_display = ['id', 'name', 'model', 'file_uuid', 'created',
99+
'start_date', 'end_date',
100+
'original_filename', 'original_timestamp_col',
101+
'original_value_col', 'is_uploading', 'failure',
102+
'message', 'upload_task']
103+
104+
105+
class Scenario_Admin(admin.ModelAdmin):
106+
list_display = ['id', 'name', 'model', 'created', 'updated']
107+
108+
109+
class Scenario_Loc_Tech_Admin(admin.ModelAdmin):
110+
list_display = ['id', 'scenario', 'loc_tech', 'model', 'created']
111+
112+
113+
class Scenario_Param_Admin(admin.ModelAdmin):
114+
list_display = ['id', 'scenario', 'run_parameter', 'year', 'value',
115+
'model', 'created', 'updated']
116+
117+
118+
class Run_Admin(admin.ModelAdmin):
119+
list_display = ['id', 'scenario', 'year', 'subset_time', 'status',
120+
'message', 'description', 'created', 'updated',
121+
'inputs_path', 'logs_path', 'outputs_path',
122+
'plots_path', 'model', 'build_task', 'run_task']
123+
124+
125+
admin.site.register(Help_Guide, Help_Guide_Admin)
126+
admin.site.register(Parameter, Parameter_Admin)
127+
admin.site.register(Abstract_Tech, Abstract_Tech_Admin)
128+
admin.site.register(Abstract_Tech_Param, Abstract_Tech_Param_Admin)
129+
admin.site.register(Run_Parameter, Run_Parameter_Admin)
130+
admin.site.register(Model, Model_Admin)
131+
admin.site.register(Model_User, Model_User_Admin)
132+
admin.site.register(User_Profile, User_Profile_Admin)
133+
admin.site.register(Model_Comment, Model_Comment_Admin)
134+
admin.site.register(Model_Favorite, Model_Favorite_Admin)
135+
admin.site.register(User_File, User_File_Admin)
136+
admin.site.register(Location, Location_Admin)
137+
admin.site.register(Technology, Technology_Admin)
138+
admin.site.register(Tech_Param, Tech_Param_Admin)
139+
admin.site.register(Loc_Tech, Loc_Tech_Admin)
140+
admin.site.register(Loc_Tech_Param, Loc_Tech_Param_Admin)
141+
admin.site.register(Timeseries_Meta, Timeseries_Meta_Admin)
142+
admin.site.register(Scenario, Scenario_Admin)
143+
admin.site.register(Scenario_Loc_Tech, Scenario_Loc_Tech_Admin)
144+
admin.site.register(Scenario_Param, Scenario_Param_Admin)
145+
admin.site.register(Run, Run_Admin)

calliope_app/api/apps.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import os
2+
from django.apps import AppConfig
3+
from django.conf import settings
4+
5+
6+
class ApiConfig(AppConfig):
7+
name = 'api'
8+
9+
def ready(self):
10+
if not os.path.exists(settings.DATA_STORAGE):
11+
os.makedirs(settings.DATA_STORAGE, exist_ok=True)

0 commit comments

Comments
 (0)