How to alias an output for automatic connection? - openmdao

I currently have this code:
self.add_subsystem('IntegrateForTheta2Ue6', utilities.CumulativeIntegrateTrapeziums(n=n),
promotes_inputs=[('x', 'panel_lengths'),
('x0', 'stagnation_point_position'),
('y', 'ue5'),
('y0', 'panel_start_external_tangential_velocity')],
promotes_outputs=[('cumulative_integral', 'intue5')])
self.add_subsystem('ThwaitesCalculateMomentumThickness', ThwaitesCalculateMomentumThickness(n=n),
promotes_inputs=['external_tangential_velocities',
'intue5',
'kinematic_viscosity'],
promotes_outputs=['momentum_thickness'])
It does not throw any errors when run, but when debugging it is clear that the output for intue5 aka cumulative_integral is not being passed into ThwaitesCalculateMomentumThickness - it appears as all ones. When I try the above with self.connect('IntegrateForTheta2Ue6.intue5', 'ThwaitesCalculateMomentumThickness.intue5'), I get Attempted to connect from 'IntegrateForTheta2Ue6.intue5' to 'ThwaitesCalculateMomentumThickness.intue5', but 'IntegrateForTheta2Ue6.intue5' doesn't exist.
Am I making a mistake in my output aliasing, or is this a bug?

Updating to the latest version of OpenMDAO worked. I believe I was already calling run_model(), so I'm not sure why it wasn't working.

Related

CSS file appears as rubbish

I've been using Cloud 9 (ace-editor) for a while, and recently we made an local server-cache solution that allow us to store local cachefiles of previewfiles from cloud9.
When I include a file directly from preview.c9, it works! But when I run the local cache version I end up with a file looking like this
‹������ÅXmoÛ6þî_Á¹Ü‘å·$ŽŠaÅú2Y»�Éö¥ÛJ¢mV/Ô(*MZô¿ïŽ/2¥ÈA‹í‡$6yw<Þ=÷Ü1Ï’•5Sdüçõ«`=~:z¶¥
64aäãˆû­àù]D&q“òD”“§°SË$"ÌOÂ0ͧ©U,n›šIP¬TÓDa.V'ç'³³y˜¤e Y-™°:Lr2ÁV6¥
+)2æ 'ƒ&—¸’†xxhÏœ2¡~^-ÖëÓ“³ÅäÉ÷öàg~;y’U'¬ˆYš²4Üë®b“'Çß2<ïÅfãŧõ׿±+J
z¢dþC`ê›m—GÀû¼Á¶A“Fú{Æ·;‘³š#Èôr­îr¶_ý4ŠEzw<ªŽGuEËãÝ×JÍ?€ä|]ݶÚjËçòš\Ѳž“þP*|ótôi´›÷õWV¿ rËË J‰""Ëš…E_a±òt·ˆEž¢‰È…ŒÈ£Ùl†ÚÓX•Z?2e°1¯nI-rž¢ÈâùÉ
•Ìf iÊ›:" é‚ѹáÞ¶STìV)K„¤Š‹ÃV2Ô®DÍÍŠd9ìÝèÕ”×UN]x™ó’q.’ŒüÀ‹JHEK¥5išòr‘Ss¼þÈFú*•‘r¶ô­N䢘A±ZÛ»Bc¸y£»‚ç[F‹ÈxŒ_cšd[)š2
xA·oäÁRU}&*)ÊtÇ8^±
y!’!zU¿ÃS€¥æ8ï(É*F56Fñ#º&4`“ÿ÷<U»ˆ,t�:ž`âM(/QÕ„jn!…á|«�nLý4ŽsZŽÿéDVšƒVÈGt®µÚˆMþfñìTw]J®l%¢#¦ÄQµÙ#¹{.ÏážG!¬Ù›ÒF ñu’ÃéV¢ŠH�à÷£1û¿Y8Eê˜Ò"UCÔUÒÛ$§u
1C,½ ݇ã=qú?pÙ‰è؆TCÔÅËáÂ1†p#• (¹²YÔµT¤ƒfxÈÓðF�øÓÍÐcººÛ�RIJ뢇_4¥#ìûáGªØø•-��j²)K}}³³3t§Ÿ9Ÿ‹|ðï,Ò}”«
Çm`Ïh\Ìá{'¢ֺ-¤¹-Ñ>ÅÛå=d}²üð2e·Pà÷£CøFÒÂðÛÏ–ßØ3©ð¨€Ö
Ž®`ˆåçƒÜÌaÍOškS³a¼\!²Ì¼ÐnÞ±èëáEgÚ«>›˜™`OKºÿb<ÔÛfH+PÖ–¿°Óú°¶¬‡·MÍt~Â
]¾v08 =â``ìöÙSëW[_~GC¼¶Éëwi0?]{øûõyðœ–
t»Yßo7_—7ô_
m‡àÁªuÖ¶×躳¤[í´¿¶ýÀ¼¥n9U'¥Èô(DH>~RôÈçÓÝl¢hœú°³ÉiUÃ|ã>íÁÀä›è™˜h¨ý* 3nE%¼†P ÇH½GŸ½›8úµ³îË”«×¬l®¹ÂQüx%ÖÌÏ0p ùç;ZnÙËœpÞ5<¿"‚ï
Üršo€#rÅ2±jÑÐõRçó³­¼fy.
…<’£~e‹þ£wžõô*ãyÎ4×hO»î\JžeL1CFž)¿õvUzýutæ¦úwP+É+è­®\Óüˆ‰V4u-í0F;&„¯á‘ÉÊàùRnQiw2uá\µ—Õ”:Ü_˜¤kɲ¬® päóÏ í«¥wÄEI«ÊØw;ÆÍßé–d¸ÙªïŸNÒºù[†C·‘ÓcÐÏÀÅ/í|î n%­v¢¿JªŸvtªí%úQã§Äøx‘H¿gLØû×=¹¸‰]±º»X|—,Æv=qü·LÆî¿A4†­«(Js5 ú‹l çžÕ*Jš>×uâBox’7Ï´®Ø%>D0µ:F5¼>N½Rï˜Äd+˜Šd#î…È,~O0¡9+ÓA«z«s›ÙnȨѭ†Gúél¼„øýÊ{#¶-ȼ´¸ÆÉaºL¡gù
1‡Î鬧 ‘ó€BÊPâ] è°Òz‰­ÔwËé°
oT�P¨Ìú*X‡5ÎÙyï�Øâñ¢'ŽX–Çì-ú±Ä”^¯úÆ쪜Ÿë\x‰0Ø;¨°ŽÏô`lþZvx²��
Any idea of whats cousing this?
PS: Sorry for poor english
Found an error in the encoding import.
I will return with the error / and fix as soon I get it firmly tested.

R Package IBrokers placeOrder() function fails

I'm using the package: IBrokers. It works well for me when I request historical data. Also the call to reqAccountUpdates() works well.
I am having problems with this script:
# myscript.r
.libPaths("rpackages")
library(IBrokers)
tws2 = twsConnect(2)
print('Attempting BUY')
mytkr = twsFuture("ES","GLOBEX","201412")
myorderid = sample(1001:3001, 1)
IBrokers:::.placeOrder(tws2, mytkr, twsOrder(myorderid, "BUY", "1", "MKT"))
twsDisconnect(tws2)
Sometimes the above script works okay. Usually though it fails. When it fails, it seems to connect okay.
Then I see this in my TWS console:
03:47:45:581 JTS-EServerSocket-290: [2:47:71:1:0:0:0:ERR] Message type -1. Socket I/O error -
03:47:45:581 JTS-EServerSocket-290: Anticipated error
jextend.d: Socket I/O error -
at jextend.sc.b(sc.java:364)
at jextend.ch.sb(ch.java:1534)
at jextend.ch.run(ch.java:1390)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:196)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
at java.net.SocketInputStream.read(SocketInputStream.java:210)
at jextend.xh.d(xh.java:45)
at jextend.sc.c(sc.java:579)
at jextend.sc.r(sc.java:227)
at jextend.af.a(af.java:232)
at jextend.sc.f(sc.java:650)
at jextend.pd.a(pd.java:822)
at jextend.sc.b(sc.java:358)
... 3 more
03:47:45:583 JTS-EServerSocket-290: [2:47:71:1:0:0:0:ERR] Socket connection for client{2} has closed.
03:47:45:583 JTS-EWriter14-291: [2:47:71:1:0:0:0:ERR] Unable write to socket client{2} -
03:47:45:584 JTS-EServerSocketNotifier-288: Terminating
Can you offer any ideas on how you would wrestle with this issue?
One other piece of info:
I think the call to reqIds() may be necessary. Sometimes reqIds() would return an id not high enough. Then, I'd use it and placeOrder() would fail. So, I call reqIds() but then use Sys.time() to give me an id which is larger than the last ID I used.
Another problem may have been some code-text I copied out of a PowerPoint. Some of the code-characters may have been corrupt.
The main problem was orderid.
I need to be careful how I generate orderid.
Also I may have moused in bad characters from a powerpoint preso which had an example.
I posted some code which works in a comment in this thread.
Dan

Turbo Pascal BGI Error: Graphics not initialized (use InitGraph)

I'm making a Turbo Pascal 7.0 program for my class, it has to be on Graphic Mode.
A message pops up
BGI Error: Graphics not initialized (use InitGraph).
I'm already using InitGraph and graph.tpu and I specified the route as "C:\TP7\BGI".
My S.O is Windows 7 and I'm using DosBox 0.74, I already tried to paste all the files from the folder BGI into BIN.
What should I do?
Since dos doesn't have system graphic drivers, the BGI functions as such for BP7.
So in short, use a BGI suitable for your videocard. The ones supplied with BP7 are very old, there are newer, VESA ones that you could try.
Afaik 3rd party BGI needs to be registered explicitly in code though.
At first I have had this "missing Graph.tpu"- ... and later the "Use Initgraph"-issue too.
After hours trying (and reading some not politeful comments in the internet) I finally got Turbo Pascal 7 succesfully running (in Windows 10, x64). In summary I want to share "some secrets":
install the "TP(WDB)-7.3.5-Setup.msi" (comes from clever people in Vietnam)
make sure, that there's the CORRECT PATH to the "BGI"-directory in your program-code. For example:
driver := Detect;
InitGraph (driver, modus, 'c:\TPWDB\BGI');
(By the way: This is ALL, what's there to do with "Initgraph".)
make sure, that in TP7 under "Options" --> "Directories" are the CORRECT PATHS both to "C:\TPWDB\UNITS" and Your actual working dir e.g. "C:\TPWDB\myPrograms"
THAT's IT.
Annotations: The "Graph.TPU" (usually) is already in "UNITS" (together with "Graph3.tpu" by the way).
Hazzling around old driver's isn't needed even... :)
Just the correct paths... :)
Hope, that can help ...

Clear console for each run of Testacular/Karma + Jasmine

It is difficult for me to catch with the eye a boundary between test runs.
Is it possible to clear console for each run of Testacular/Karma + Jasmine or at least put there something easily catched by the eye, for example a series of newlines?
Note
Currently it is an abandoned question because I am no longer trying to perform tasks described in it. Please do not ask for additional info. Write only if you know for sure what to do. It will help other people.
Write your own reporter, and do whatever you want with it.
Also, if you're on a Mac and use Growl, take a look at karma-growl-reporter
I am not sure to fully understand your need but karma-spec-reporter can give you a detailed review of your test execution. Output example from karma-spec-reporter-example:
array:
push:
PASSED - should add an element
PASSED - should remove an element
FAILED - should do magic (this test will fail) expected [] to include 'magic'
at /home/michael/development/codecentric/karma-spec-reporter-example/node_modules/chai/chai.js:401
...
PhantomJS 1.8.1 (Linux): Executed 3 of 3 (1 FAILED) (0.086 secs / NaN secs)
There's now a reporter available for this: https://github.com/arthurc/karma-clear-screen-reporter
It's working for me on OSX.

Silencing ChromeDriver.exe logging

I am running ruby unit tests against Chrome using watir-webdriver. Whenever a test is run and chromedriver.exe is launched output similar to below appears:
Started ChromeDriver
port=9515
version=26.0.1383.0
log=C:\Home\Server\Test\Watir\web\chromedriver.log
[5468:8796:0404/150755:ERROR:accelerated_surface_win.cc(208)] Reseting D3D device
[5468:8996:0404/150758:ERROR:textfield.h(156)] NOT IMPLEMENTED
[WARNING:..\..\..\..\flash\platform\pepper\pep_module.cpp(63)] SANDBOXED
None of this impacts the correct functioning of the tests, but as one might imagine the appearance of "ERROR" and "WARNING" might be rather confusing to, for example, parsing rules in Jenkins looking for failures. Sure I can get really fancy with regular expression in the parsing rules, but it would be really nice to turn off this verbose and unnecessary logging on the part of chromedriver.exe. I have seen many mentions of this searching for an answer. No one has come up with a solution. Yes, chromedriver possibly has a "--silent" option, but there seems to be no way to pass that to the executable. Code similar to below is supposed to work, but has zero effect as far as I can see. Any ideas?
profile = Selenium::WebDriver::Chrome::Profile.new
profile['--cant-make-any-switches-work-here-how-about-you'] = true
browser = Watir::Browser.new :chrome, :profile => profile, :switches => %w[--ignore-certificate-errors --disable-extensions --disable-popup-blocking --disable-translate--allow-file-access]
Here's help for anyone else searching
Find ...selenium\webdriver\chrome\service.rb
Path start may differ on your system
And I added "-silent" to the passed parameters .... However, this silenced everything but the error/warning messages.
def initialize(executable_path, port)
#uri = URI.parse "http://#{Platform.localhost}:#{port}"
server_command = [executable_path, " -silent", "--port=#{port}"]
#process = ChildProcess.build(*server_command)
#socket_poller = SocketPoller.new Platform.localhost, port, START_TIMEOUT
#process.io.inherit! if $DEBUG == true
end
set chromeOptions with key --log-level=3 this should shut it up
I was able to divert the hundreds, yes hundreds, of chrome driver log messages that were showing up in cucumber stdout by using the :service_log_path argument.
#browser = Watir::Browser.new :chrome, :service_log_path => 'chromedriver.out'
the '-silent', or '--silent', or ' -silent', or ' --silent' parameter suggested above did nothing when I added it to ...selenium\webdriver\chrome\service.rb. And having to tweak the gem itself is not a particularly viable solution.
I couldn't find a place to capture the chromedriver stderr and divert it to null (not to mention having to handle doing that in windows and in *nix/osx)
The driver should default to something way less verbose. In this case INFO is way too verbose as hundreds of log entries pop out as INFO, 90%+ of them identical.
At least the :service_log_path argument works most of them.
You can try -Dwebdriver.chrome.logfile="/dev/null" and/or -Dwebdriver.chrome.args="--disable-logging" to the options of java that runs selenium-server-standalone-what.ever.jar

Resources