/// <summary> /// Updates the dictionary with the elements from the another dictionary object or from an iterable of Symbol/value pairs. /// The update() method adds element(s) to the dictionary if the Symbol is not in the dictionary.If the Symbol is in the dictionary, it updates the Symbol with the new value. /// </summary> /// <param name="other">Takes either a dictionary or an iterable object of Symbol/value pairs (generally tuples).</param> public void update(PyObject other) { if (IsReadOnly) { throw new InvalidOperationException($"update method call is an invalid operation. {GetType().Name} is a read-only collection."); } var dictionary = other.ConvertToDictionary <Symbol, T>(); foreach (var kvp in dictionary) { this[kvp.Key] = kvp.Value; } }
/// <summary> /// Initializes a new instance of the <see cref="InceptionDateUniverseSelectionModel"/> class /// </summary> /// <param name="name">A unique name for this universe</param> /// <param name="tickersByDate">Dictionary of DateTime keyed by String that represent the Inception date for each ticker</param> public InceptionDateUniverseSelectionModel(string name, PyObject tickersByDate) : this(name, tickersByDate.ConvertToDictionary <string, DateTime>()) { }
/// <summary> /// Send an email to the address specified for live trading notifications. /// </summary> /// <param name="subject">Subject of the email</param> /// <param name="message">Message body, up to 10kb</param> /// <param name="data">Data attachment (optional)</param> /// <param name="address">Email address to send to</param> /// <param name="headers">Optional email headers to use</param> public bool Email(string address, string subject, string message, string data, PyObject headers) { return(Email(address, subject, message, data, headers.ConvertToDictionary <string, string>())); }
/// <summary> /// Place REST POST call to the specified address with the specified DATA. /// Python overload for Headers parameter. /// </summary> /// <param name="address">Endpoint address</param> /// <param name="data">Data to send in body JSON encoded</param> /// <param name="headers">Optional headers to use</param> public bool Web(string address, object data, PyObject headers) { return(Web(address, data, headers.ConvertToDictionary <string, string>())); }