This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Example of installing django-taggit onto a Zinnia Entry model | |
(django-blog-zinnia) which traditionally uses django-tagging. | |
The django-taggit manager is installed on the tagged_as attribute because | |
tagged is already taken by the existing django-tagging installation (which we don't remove). | |
""" | |
from django.contrib import admin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os,sys | |
sys.path.append(r"C:\Program Files\PTI\PSSE32\PSSBIN") | |
os.environ['PATH'] = (r"C:\Program Files\PTI\PSSE32\PSSBIN;" | |
+ os.environ['PATH']) | |
os.chdir(r"C:\work_dir") | |
import psspy | |
import redirect | |
_i=psspy.getdefaultint() | |
_f=psspy.getdefaultreal() | |
_s=psspy.getdefaultchar() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os,sys | |
PSSE_LOCATION = r"C:\Program Files\PTI\PSSE32\PSSBIN" | |
sys.path.append(PSSE_LOCATION) | |
os.environ['PATH'] = os.environ['PATH'] + ';' + PSSE_LOCATION | |
import psspy | |
import redirect | |
redirect.psse2py() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
featured on our blog all about PSSE and Python: | |
blog.whit.com.au | |
""" | |
import os,sys | |
PSSE_LOCATION = r"C:\Program Files\PTI\PSSE32\PSSBIN" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import groupby | |
from operator import itemgetter | |
attr_type = itemgetter(0) | |
import psspy | |
def subsystem_info(name, attributes, sid=-1, inservice=True): | |
""" | |
Returns requested attributes from the PSS(r)E subsystem API | |
for the given subsystem id and subsystem element name. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Transaction | |
----------- | |
Wrap your PSSe Python code in this transaction and watch it rollback | |
when the case blows up. | |
""" | |
from __future__ import with_statement | |
import contextlib | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import with_statement | |
import os | |
from transactions import transaction, psspy, PSSE_EXAMPLES | |
psspy.throwPsseExceptions = False | |
def validate_solved(): | |
""" | |
Return true if the last psse case has solved. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import with_statement | |
import os | |
import sys | |
import csv | |
# Location of libraries | |
sys.path.append("C:\\Code\\trunk\\libs\\psselib") # psse_utilities | |
sys.path.append("C:\\Code\\trunk\\libs\\filelib") # file utils | |
sys.path.append("C:\\program files\\pti\\psse32\\pssbin") # psspy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Add machines (gens and svcs) to the working case from a CSV file named: | |
``genslist.csv `` | |
This csv file **must** exist in the current directory. For | |
gens we add all to the case with status off. ECDI will take care of status. | |
For SVCs we only want them to be in service in and after the year specified in | |
the CSV. (Neither ECDI nor OPF [since fict SVCs control their own bus] will | |
control status of fict SVCs) NOTE: Script only works correctly IF case name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
table { | |
width: 100%; | |
margin-bottom: 18px; | |
padding: 0; | |
font-size: 13px; | |
border-collapse: collapse; | |
} | |
table th, table td { | |
padding: 10px 10px 9px; |
OlderNewer