Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
Merge branch 'develop-create-python-folder' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
David P. Chassin committed Mar 8, 2022
2 parents be7203b + 1dd8841 commit 8da30ce
Show file tree
Hide file tree
Showing 26 changed files with 24 additions and 23 deletions.
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ object_profile.txt
fault_check.txt

# specific outputs that should be ignored
gldcore/link/python/example.png
python/example.png
models/ieee123/config/local.glm
converters/autotest/IEEE-*-cyme/*
gridlabd.glm
Expand Down Expand Up @@ -180,6 +180,7 @@ gldcore/autotest/output.csv
python_extras/example/output.csv
*.egg
gridlabd.egg-info/
gldcore/link/python/dist/
gldcore/link/python/gridlabd.egg-info/
python/dist/*.whl
python/dist/*.tar.gz
python/gridlabd.egg-info/
gridlabd.egg-*
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ include $(top_srcdir)/python_extras/Makefile.mk
include $(top_srcdir)/converters/Makefile.mk
include $(top_srcdir)/cloud/Makefile.mk
include $(top_srcdir)/utilities/Makefile.mk
include $(top_srcdir)/python/Makefile.mk

# approved modules
include $(top_srcdir)/modules.mk
Expand Down
3 changes: 1 addition & 2 deletions gldcore/Makefile.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
include gldcore/link/engine/Makefile.mk
include gldcore/link/matlab/Makefile.mk
include gldcore/link/python/Makefile.mk
include gldcore/rt/Makefile.mk
include gldcore/solvers/Makefile.mk
include gldcore/scripts/Makefile.mk
Expand Down Expand Up @@ -75,7 +74,7 @@ gridlabd_bin_SOURCES += gldcore/transform.cpp gldcore/transform.h
gridlabd_bin_SOURCES += gldcore/unit.cpp gldcore/unit.h
gridlabd_bin_SOURCES += gldcore/validate.cpp gldcore/validate.h
gridlabd_bin_SOURCES += gldcore/version.cpp gldcore/version.h
gridlabd_bin_SOURCES += gldcore/link/python/python.cpp
gridlabd_bin_SOURCES += python/python.cpp

EXTRA_gridlabd_bin_SOURCES =
EXTRA_gridlabd_bin_SOURCES += gldcore/cmex.c gldcore/cmex.h
Expand Down
13 changes: 0 additions & 13 deletions gldcore/link/python/Makefile.mk

This file was deleted.

13 changes: 13 additions & 0 deletions python/Makefile.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
$(top_srcdir)/python/dist/gridlabd-$(notdir $(prefix))-.tar.gz: gldcore/build.h
@echo "building $@"
@python3 -m pip install build 1>/dev/null
@( export SRCDIR=$(realpath $(top_srcdir)) ; python3 -m build $(top_srcdir)/python 1>/dev/null )

python-install: $(top_srcdir)/python/dist/gridlabd-$(notdir $(prefix))-.tar.gz
@echo "installing $@"
@python3 -m pip install --ignore-installed $(top_srcdir)/python/dist/gridlabd-*.whl

python-clean:
@rm $(top_srcdir)/python/dist/*.{whl,tar.gz}
@echo "uninstalling $(top_srcdir)/python"
@python3 -m pip uninstall gridlabd -y || (echo "Use '. utilities/cleanwc' instead to clean this build."; exit 1)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions gldcore/link/python/setup.py → python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
To build only the python module use the following command can be run after gridlabd is installed
bash% export SRCDIR=$PWD
bash% python gldcore/link/python/setup.py build
bash% python python/setup.py build
To install the python module use the following command:
bash% export SRCDIR=$PWD
bash% python gldcore/link/python/setup.py install
bash% python python/setup.py install
To uninstall the python module, you must save the list of installed files
bash% export SRCDIR=$PWD
bash% python gldcore/link/python/setup.py install --record files.txt
bash% python python/setup.py install --record files.txt
Then you can uninstall gridlabd's python module using the command
Expand Down Expand Up @@ -47,10 +47,10 @@

from distutils.core import setup, Extension
gridlabd = Extension('gridlabd',
include_dirs = list(map(lambda x: srcdir+'/'+x,['gldcore/link/python','gldcore'])),
include_dirs = list(map(lambda x: srcdir+'/'+x,['python','gldcore'])),
extra_compile_args = compile_options,
libraries = ['ncurses', 'curl'],
sources = list(map(lambda x: srcdir+'/'+x,['gldcore/link/python/python.cpp',
sources = list(map(lambda x: srcdir+'/'+x,['python/python.cpp',
'gldcore/aggregate.cpp',
'gldcore/class.cpp',
'gldcore/cmdarg.cpp',
Expand Down
File renamed without changes.

0 comments on commit 8da30ce

Please sign in to comment.