Hi, I am trying to apply covariance risk budget constraints in a Markowitz mean variance model. I am not able to use the solver 'solveRdonlp2' - optimization

Error in loadNamespace(x) : there is no package called ‘Rdonlp2’
Where can I download the package

This worked for me:
Install rtools (https://cran.r-project.org/bin/windows/Rtools/rtools42/rtools.html)
install.packages("Rdonlp2", repos="http://R-Forge.R-project.org")

Related

Pylint: same pylint and pandas version on 2 machines, 1 fails

I have 2 places running the same linting job:
Machine 1: Ubuntu over SSH
pandas==1.2.3
pylint==2.7.4
python 3.8.10
Machine 2: Gitlab CI Docker image, python:3.8.12-buster
pandas==1.2.3
pylint==2.7.4
Python 3.8.12
The Ubuntu machine is able to lint all the code fine, and it has for many months. Same for the CI job, except it had been running Python 3.7.8. Now that I upgraded the Docker image to Python 3.8.12, it throws several no-member linting errors on some Pandas objects. I've tried clearing CI caches etc.
I wish I could provide something more reproducible. But, to check my understanding of what a linter is doing, is it theoretically possible that a small version difference in python messes up pylint like this? For something like a no-member error on Pandas objects, I would think the dominant factor is the pandas version, but those are equal, so I'm confused!
Update:
I've looked at the Pandas code for pd.read_sql_query, which is what's causing the no-member error. It says:
def read_sql_query(
sql,
con,
index_col=None,
coerce_float=True,
params=None,
parse_dates=None,
chunksize: Optional[int] = None,
) -> Union[DataFrame, Iterator[DataFrame]]:
In Docker, I get E1101: Generator 'generator' has no 'query' member (no-member) (because I'm running .query on the returned dataframe). So it seems Pylint thinks that this function returns a generator. But it does not make this assumption in my other setup. (I've also verified the SHA sum of pandas/io/sql.py matches). This seems similar to this issue, but I am still baffled by the discrepancy in environments.
A fix that worked was to bump a limit like:
init-hook = "import astroid; astroid.context.InferenceContext.max_inferred = 500"
in my .pylintrc file, as explained here.
I'm unsure why/if this is connected to my change in Python version, but I'm happy to use this and move on for now. It's probably complex.
(Another hack was to write a function that returns the passed arg if the passed arg is a dataframe, and returns 1 dataframe if the passed arg is an iterable of dataframes. So the ambiguous-type object could be passed through this wrapper to clarify things for Pylint. While this was more intrusive on our codebase, we had dozens of calls to pd.read_csv and pd.real_sql_query, and only about 3 calls caused confusion for Pylint, so we almost used this solution)

Using Optaplanner for VRPPD

I am trying to run the example "optaplanner-mixedvrp-experiment" developed by Geoffrey De Smet and when I run it it throws me the following error:
Caused by: java.lang.IllegalStateException: The entity (MY) has a
variable (previousStandstill) with value (MUNO) which has a
sourceVariableName variable (nextVisit) with a value (WERBOMONT) which
is not null. Verify the consistency of your input problem for that
sourceVariableName variable.
I have not made any change, I have only cloned and executed it, I import and solve it and it throws me this error.
Do you know what could be happening?
I am applying it in the development of a variant of VRP with multiple deliveries and collections, but it throws me the same error. I have activated the FULL_ASSERT mode and nextVisit, previousStandstill, visitIndex are always null
It's been a long time since I looked at that code, so it's using an old version of optaplanner. Our goal is still to clean it up and offer an out of the box example for VRPPD (and probably remove some boilerplate along the way, using the upcoming #CollectionPlanningVariabe etc). That being said, we have multiple users&customers who used that optaplanner-mixedvrp-experiment to successfully build VRPPD implementations.
Which dataset did you try?
FWIW, that IllegalStateException says that when A.previous = B, the B.next is not A. So either the dataset importer didn't import it correctly - before calling solve() - especially if it fails before the first CH step in FULL_ASSERT. Or one of the custom moves corrupted the model.

How to get an edge's id using TraCi?

I'm using a python code with the traci library to know if there are any vehicles near a certain distance to a chosen vehicle, to test a solution I'm trying to implement I need to know a vehicle's current edge.
I'm on Ubuntu 18.04.3 LTS, using sublime to edit the code and the os, sys, optparse, subprocess, random, math libraries. I've tried using getLaneId and getEdgeId, the last one is not in the documentation but I tough I've seen it somewhere and tried to test it.
. Another option that i had was using getNeighbors but i didn't know exactly how to use it and it returned the same error message as the previous commands.
def run():
step = 0
while traci.simulation.getMinExpectedNumber() > 0:
traci.simulationStep()
print(step)
print(distancia("veh1","veh0"))
step += 1
if step > 2:
print(traci.vehicle.getLaneId("veh0"))
traci.close()
sys.stdout.flush()
All of them returned the following error message : AttributeError: VehicleDomain instance has no attribute 'getLaneId'. But I think the vehicle domain has indeed the getLaneId attribute since it is in the documentation: https://sumo.dlr.de/pydoc/traci._vehicle.html#VehicleDomain-getSpeed.
I was expecting it to return the edge's id. Please I need help with this problem. Thank you in advance.
The TraCI command for edgeID can be found in the _vehicle.VehicleDomain module. The syntax is as follows:
traci._vehicle.VehicleDomain.getRoadID(self, vehicleID)
It needs to be getLaneID with a capital D.

wx Widgets multiple errors in Windows 10

I have downloaded wxWidgets-3.0.2 and am trying to create a simple FRAME from the main program.
Unfortunately I am receiving multiple errors that are all to do with wxWidgets, NOT my code. This is odd as I am lead to believe wxWidgets should work.
Here are some of the errors I am getting:
*\msw\chkconf.h(19): Error! E080: col(10) "wxUSE_ACTIVEX must be defined."
\msw\chkconf.h(394): Error! E080: col(13) "wxUSE_DATAOBJ requires wxUSE_OLE"
\msw\chkconf.h(414): Error! E080: col(13) "wxMediaCtl requires wxActiveXContainer"
\chkconf.h(1630): Error! E080: col(13) "wxRearrangeCtrl requires wxCheckListBox"
\vector.h(197): Error! E148: col(71) access to private member 'reverse_iterator::m_ptr' is not allowed
\vector.h(187): Note! N392: col(21) definition: 'wxToolTip * * wxVector<wxToolTip *>::reverse_iterator::m_ptr'*
Why am I receiving these messages when wxWidgets is supposed to be ready to go?
Have you configured properly? If not try this link to configure on Windows. Also, you can try to use Linux. It is much easier to set up WxWidgets.
High level steps to installing wxWidgets:
Download ( you appear to have done this )
Build library ( I cannot tell if you have done this )
-OR-
Download binary built libraries if available for your compiler ( what compiler are you using - you haven't told us! )
Build one or two of the sample programs ( It really does not look like you have done this )
NOT UNTIL you have completed all these steps are you "ready to go"

gentoo ask me to reinstall all packages I just have unmerged

I want to completely unmerge webkit-gtk in the system, to do that, I firstly check all the packages that are dependent on webkit-gtk by:
enquire depends webkit-gtk
ae429-3777 chenming # equery depends webkit-gtk
* These packages depend on webkit-gtk:
gnome-extra/gnome-documents-3.8.5 (>=net-libs/webkit-gtk-1.10.0:3)
gnome-extra/sushi-3.10.0 (net-libs/webkit-gtk:3[introspection])
gnome-extra/yelp-3.8.1 (>=net-libs/webkit-gtk-1.3.10:3)
gnome-extra/zenity-3.8.0 (>=net-libs/webkit-gtk-1.4.0:3)
media-gfx/gimp-2.8.10-r1 (webkit ? >=net-libs/webkit-gtk-1.6.1:2)
media-gfx/shotwell-0.15.1 (>=net-libs/webkit-gtk-1.4:3)
media-sound/rhythmbox-3.0.2 (html ? >=net-libs/webkit-gtk-1.10:3)
(webkit ? >=net-libs/webkit-gtk-1.10:3[introspection])
net-im/empathy-3.8.6 (>=net-libs/webkit-gtk-1.9.1:3)
net-libs/gnome-online-accounts-3.10.4 (>=net-libs/webkit-gtk-2.1.90:3)
net-libs/libproxy-0.4.11-r1 (webkit ? >=net-libs/webkit-gtk-1.6:3)
once I have unemerged all these packages by
emerge -C gnome-extra/gnome-documents-3.8.5 gnome-extra/sushi-3.10.0 gnome-extra/yelp-3.8.1 gnome-extra/zenity-3.8.0 media-gfx/gimp-2.8.10-r1 media-gfx/shotwell-0.15.1 media-sound/rhythmbox-3.0.2 net-im/empathy-3.8.6 net-libs/gnome-online-accounts-3.10.4 net-libs/libproxy-0.4.11-r1 webkit-gtk
then again update the system by running:
emerge -avuDN world
The webkit-gtk comes out in the list again
[ebuild N ] net-libs/webkit-gtk-2.2.6:3/29 USE="egl geoloc gstreamer introspection jit libsecret opengl spell webgl (-aqua) -coverage -debug -gles2 {-test}" 0 kB
[ebuild N ] gnome-extra/sushi-3.10.0 USE="-office" 0 kB
[ebuild N ] net-libs/gnome-online-accounts-3.10.4:0/1 USE="gnome introspection -debug -kerberos" 0 kB
How to completely erradicat these packages? Thanks very much
In your case other packages in world depend indirectly on webkit-gtk.
You unmerged all packages that depend directly on webkit-gtk, but there are others that depend indirectly via gnome-extra/sushi and net-libs/gnome-online-accounts.
If you want to get rid of webkit-gtk you have to remove all indirect dependencies as well.
So the idea is to check which packages depend on gnome-extra/sushi and net-libs/gnome-online-accounts and remove them as well (if you don't need them them!).
You might have to do this dependency checking several times until you eventually find all packages in world which pull in webkit-gtk in a cascade of dependencies.
You might want to check with emerge --tree -avuDN world. That way you do see the dependency tree and might figure out which package actually wants webkit-gtk.