Skip to content

Commit

Permalink
Fix warnings CA1574 (#8186)
Browse files Browse the repository at this point in the history
  • Loading branch information
Marinovsky authored Jul 9, 2024
1 parent 268285e commit 5a7a162
Show file tree
Hide file tree
Showing 24 changed files with 40 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Algorithm/QCAlgorithm.History.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,7 @@ private void CheckPeriodBasedHistoryRequestResolution(IEnumerable<Symbol> symbol
/// <remarks>
/// This method is only used for Python algorithms, specially for those requesting custom data type history.
/// The reason for using this method is that custom data type Python history calls to
/// <see cref="History{T}(QuantConnect.Symbol, int, Resolution?)"/> will always use <see cref="PythonData"/> (the custom data base class)
/// <see cref="History{T}(QuantConnect.Symbol, int, Resolution?, bool?, bool?, DataMappingMode?, DataNormalizationMode?, int?)"/> will always use <see cref="PythonData"/> (the custom data base class)
/// as the T argument, because the custom data class is a Python type, which will cause the history data in the slices to not be matched
/// to the actual requested type, resulting in an empty list of slices.
/// </remarks>
Expand Down
14 changes: 7 additions & 7 deletions Algorithm/QCAlgorithm.Trading.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public OrderTicket Order(Symbol symbol, decimal quantity)
/// <param name="tag">Place a custom order property or tag (e.g. indicator data).</param>
/// <param name="orderProperties">The order properties to use. Defaults to <see cref="DefaultOrderProperties"/></param>
/// <returns>The order ticket instance.</returns>
/// <seealso cref="MarketOrder(Symbol, decimal, bool, string)"/>
/// <seealso cref="MarketOrder(QuantConnect.Symbol, decimal, bool, string, IOrderProperties)"/>
[DocumentationAttribute(TradingAndOrders)]
public OrderTicket Order(Symbol symbol, decimal quantity, bool asynchronous = false, string tag = "", IOrderProperties orderProperties = null)
{
Expand Down Expand Up @@ -1203,7 +1203,7 @@ private OrderResponse PreOrderChecksImpl(SubmitOrderRequest request)
/// <param name="symbolToLiquidate">Symbols we wish to liquidate</param>
/// <param name="tag">Custom tag to know who is calling this.</param>
/// <returns>Array of order ids for liquidated symbols</returns>
/// <seealso cref="MarketOrder(QuantConnect.Symbol,decimal,bool,string)"/>
/// <seealso cref="MarketOrder(QuantConnect.Symbol, decimal, bool, string, IOrderProperties)"/>
[DocumentationAttribute(TradingAndOrders)]
public List<int> Liquidate(Symbol symbolToLiquidate = null, string tag = "Liquidated")
{
Expand Down Expand Up @@ -1295,7 +1295,7 @@ public void SetMaximumOrders(int max)
/// <param name="liquidateExistingHoldings">True will liquidate existing holdings</param>
/// <param name="tag">Tag the order with a short string.</param>
/// <param name="orderProperties">The order properties to use. Defaults to <see cref="DefaultOrderProperties"/></param>
/// <seealso cref="MarketOrder(QuantConnect.Symbol,decimal,bool,string)"/>
/// <seealso cref="MarketOrder(QuantConnect.Symbol, decimal, bool, string, IOrderProperties)"/>
[DocumentationAttribute(TradingAndOrders)]
public void SetHoldings(List<PortfolioTarget> targets, bool liquidateExistingHoldings = false, string tag = "", IOrderProperties orderProperties = null)
{
Expand All @@ -1322,7 +1322,7 @@ public void SetHoldings(List<PortfolioTarget> targets, bool liquidateExistingHol
/// <param name="liquidateExistingHoldings">liquidate existing holdings if necessary to hold this stock</param>
/// <param name="tag">Tag the order with a short string.</param>
/// <param name="orderProperties">The order properties to use. Defaults to <see cref="DefaultOrderProperties"/></param>
/// <seealso cref="MarketOrder(QuantConnect.Symbol,decimal,bool,string)"/>
/// <seealso cref="MarketOrder(QuantConnect.Symbol, decimal, bool, string, IOrderProperties)"/>
[DocumentationAttribute(TradingAndOrders)]
public void SetHoldings(Symbol symbol, double percentage, bool liquidateExistingHoldings = false, string tag = "", IOrderProperties orderProperties = null)
{
Expand All @@ -1337,7 +1337,7 @@ public void SetHoldings(Symbol symbol, double percentage, bool liquidateExisting
/// <param name="liquidateExistingHoldings">bool liquidate existing holdings if necessary to hold this stock</param>
/// <param name="tag">Tag the order with a short string.</param>
/// <param name="orderProperties">The order properties to use. Defaults to <see cref="DefaultOrderProperties"/></param>
/// <seealso cref="MarketOrder(QuantConnect.Symbol,decimal,bool,string)"/>
/// <seealso cref="MarketOrder(QuantConnect.Symbol, decimal, bool, string, IOrderProperties)"/>
[DocumentationAttribute(TradingAndOrders)]
public void SetHoldings(Symbol symbol, float percentage, bool liquidateExistingHoldings = false, string tag = "", IOrderProperties orderProperties = null)
{
Expand All @@ -1352,7 +1352,7 @@ public void SetHoldings(Symbol symbol, float percentage, bool liquidateExistingH
/// <param name="liquidateExistingHoldings">bool liquidate existing holdings if necessary to hold this stock</param>
/// <param name="tag">Tag the order with a short string.</param>
/// <param name="orderProperties">The order properties to use. Defaults to <see cref="DefaultOrderProperties"/></param>
/// <seealso cref="MarketOrder(QuantConnect.Symbol,decimal,bool,string)"/>
/// <seealso cref="MarketOrder(QuantConnect.Symbol, decimal, bool, string, IOrderProperties)"/>
[DocumentationAttribute(TradingAndOrders)]
public void SetHoldings(Symbol symbol, int percentage, bool liquidateExistingHoldings = false, string tag = "", IOrderProperties orderProperties = null)
{
Expand All @@ -1370,7 +1370,7 @@ public void SetHoldings(Symbol symbol, int percentage, bool liquidateExistingHol
/// <param name="liquidateExistingHoldings">bool flag to clean all existing holdings before setting new faction.</param>
/// <param name="tag">Tag the order with a short string.</param>
/// <param name="orderProperties">The order properties to use. Defaults to <see cref="DefaultOrderProperties"/></param>
/// <seealso cref="MarketOrder(QuantConnect.Symbol,decimal,bool,string)"/>
/// <seealso cref="MarketOrder(QuantConnect.Symbol, decimal, bool, string, IOrderProperties)"/>
[DocumentationAttribute(TradingAndOrders)]
public void SetHoldings(Symbol symbol, decimal percentage, bool liquidateExistingHoldings = false, string tag = "", IOrderProperties orderProperties = null)
{
Expand Down
3 changes: 2 additions & 1 deletion AlgorithmFactory/Loader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -382,12 +382,13 @@ public bool TryCreateAlgorithmInstanceWithIsolator(string assemblyPath, int ramL
return complete && success && algorithmInstance != null;
}


#pragma warning disable CS1574
/// <summary>
/// Unload this factory's appDomain.
/// </summary>
/// <remarks>Not used in lean engine. Running the library in an app domain is 10x slower.</remarks>
/// <seealso cref="AppDomain.CreateDomain(string, Evidence, string, string, bool, AppDomainInitializer, string[])"/>
#pragma warning restore CS1574
public void Unload() {
if (appDomain != null)
{
Expand Down
4 changes: 2 additions & 2 deletions Api/Api.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1517,7 +1517,7 @@ public Organization ReadOrganization(string organizationId = null)
/// <param name="target">Target of the optimization, see examples in <see cref="PortfolioStatistics"/></param>
/// <param name="targetTo">Target extremum of the optimization, for example "max" or "min"</param>
/// <param name="targetValue">Optimization target value</param>
/// <param name="strategy">Optimization strategy, <see cref="GridSearchOptimizationStrategy"/></param>
/// <param name="strategy">Optimization strategy, <see cref="QuantConnect.Optimizer.Strategies.GridSearchOptimizationStrategy"/></param>
/// <param name="compileId">Optimization compile ID</param>
/// <param name="parameters">Optimization parameters</param>
/// <param name="constraints">Optimization constraints</param>
Expand Down Expand Up @@ -1563,7 +1563,7 @@ public Estimate EstimateOptimization(
/// <param name="target">Target of the optimization, see examples in <see cref="PortfolioStatistics"/></param>
/// <param name="targetTo">Target extremum of the optimization, for example "max" or "min"</param>
/// <param name="targetValue">Optimization target value</param>
/// <param name="strategy">Optimization strategy, <see cref="GridSearchOptimizationStrategy"/></param>
/// <param name="strategy">Optimization strategy, <see cref="QuantConnect.Optimizer.Strategies.GridSearchOptimizationStrategy"/></param>
/// <param name="compileId">Optimization compile ID</param>
/// <param name="parameters">Optimization parameters</param>
/// <param name="constraints">Optimization constraints</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public bool SetTargetPortfolioFromPortfolio()

/// <summary>
/// Obtains an array of portfolio targets from algorithm's Portfolio and returns them.
/// See <see cref="PortfolioTarget.Percent(IAlgorithm, Symbol, decimal, bool)"/> for more
/// See <see cref="PortfolioTarget.Percent(IAlgorithm, Symbol, decimal, bool, string)"/> for more
/// information about how each symbol quantity was calculated
/// </summary>
/// <param name="targets">An array of portfolio targets from the algorithm's Portfolio</param>
Expand Down
2 changes: 2 additions & 0 deletions Common/CapacityEstimate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,15 @@ public void OnOrderEvent(OrderEvent orderEvent)
_monitoredSymbolCapacitySet.Add(symbolCapacity);
}

#pragma warning disable CS1574
/// <summary>
/// Updates the market capacity for any Symbols that require a market update.
/// Sometimes, after the specified <seealso cref="_snapshotPeriod"/>, we
/// take a "snapshot" (point-in-time capacity) of the portfolio's capacity.
///
/// This result will be written into the Algorithm Statistics via the <see cref="BacktestingResultHandler"/>
/// </summary>
#pragma warning restore CS1574
public void UpdateMarketCapacity(bool forceProcess)
{
for (var i = _monitoredSymbolCapacity.Count - 1; i >= 0; --i)
Expand Down
2 changes: 1 addition & 1 deletion Common/Data/Auxiliary/FactorFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public abstract class FactorFile<T> : IFactorProvider
public string Permtick { get; }

/// <summary>
/// Initializes a new instance of the <see cref="FactorFile"/> class.
/// Initializes a new instance of the <see cref="FactorFile{T}"/> class.
/// </summary>
protected FactorFile(string permtick, IEnumerable<T> data, DateTime? factorFileMinimumDate = null)
{
Expand Down
2 changes: 1 addition & 1 deletion Common/Data/Auxiliary/LocalDiskFactorFileProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void Initialize(IMapFileProvider mapFileProvider, IDataProvider dataProvi
}

/// <summary>
/// Gets a <see cref="FactorFile"/> instance for the specified symbol, or null if not found
/// Gets a <see cref="FactorFile{T}"/> instance for the specified symbol, or null if not found
/// </summary>
/// <param name="symbol">The security's symbol whose factor file we seek</param>
/// <returns>The resolved factor file, or null if not found</returns>
Expand Down
2 changes: 1 addition & 1 deletion Common/Data/Auxiliary/LocalZipFactorFileProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void Initialize(IMapFileProvider mapFileProvider, IDataProvider dataProvi
}

/// <summary>
/// Gets a <see cref="FactorFile"/> instance for the specified symbol, or null if not found
/// Gets a <see cref="FactorFile{T}"/> instance for the specified symbol, or null if not found
/// </summary>
/// <param name="symbol">The security's symbol whose factor file we seek</param>
/// <returns>The resolved factor file, or null if not found</returns>
Expand Down
4 changes: 2 additions & 2 deletions Common/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -593,8 +593,8 @@ public static bool IsEmpty(this BaseSeries series)
}

/// <summary>
/// Returns if the specified <see cref="Chart"/> instance holds no <see cref="Series"/>
/// or they are all empty <see cref="IsEmpty(Series)"/>
/// Returns if the specified <see cref="Chart"/> instance holds no <see cref="Series"/>
/// or they are all empty <see cref="Extensions.IsEmpty(BaseSeries)"/>
/// </summary>
public static bool IsEmpty(this Chart chart)
{
Expand Down
4 changes: 4 additions & 0 deletions Common/Interfaces/IApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ public interface IApi : IDisposable
/// <exception cref="ArgumentException"></exception>
public InsightResponse ReadBacktestInsights(int projectId, string backtestId, int start = 0, int end = 0);

#pragma warning disable CS1574
/// <summary>
/// Estimate optimization with the specified parameters via QuantConnect.com API
/// </summary>
Expand All @@ -214,6 +215,7 @@ public interface IApi : IDisposable
/// <param name="parameters">Optimization parameters</param>
/// <param name="constraints">Optimization constraints</param>
/// <returns>Estimate object from the API.</returns>
#pragma warning restore CS1574
public Estimate EstimateOptimization(
int projectId,
string name,
Expand All @@ -225,6 +227,7 @@ public Estimate EstimateOptimization(
HashSet<OptimizationParameter> parameters,
IReadOnlyList<Constraint> constraints);

#pragma warning disable CS1574
/// <summary>
/// Create an optimization with the specified parameters via QuantConnect.com API
/// </summary>
Expand All @@ -241,6 +244,7 @@ public Estimate EstimateOptimization(
/// <param name="nodeType">Optimization node type</param>
/// <param name="parallelNodes">Number of parallel nodes for optimization</param>
/// <returns>BaseOptimization object from the API.</returns>
#pragma warning restore CS1574
public OptimizationSummary CreateOptimization(
int projectId,
string name,
Expand Down
4 changes: 2 additions & 2 deletions Common/Interfaces/IFactorFileProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
namespace QuantConnect.Interfaces
{
/// <summary>
/// Provides instances of <see cref="FactorFile"/> at run time
/// Provides instances of <see cref="FactorFile{T}"/> at run time
/// </summary>
[InheritedExport(typeof(IFactorFileProvider))]
public interface IFactorFileProvider
Expand All @@ -34,7 +34,7 @@ public interface IFactorFileProvider
void Initialize(IMapFileProvider mapFileProvider, IDataProvider dataProvider);

/// <summary>
/// Gets a <see cref="FactorFile"/> instance for the specified symbol, or null if not found
/// Gets a <see cref="FactorFile{T}"/> instance for the specified symbol, or null if not found
/// </summary>
/// <param name="symbol">The security's symbol whose factor file we seek</param>
/// <returns>The resolved factor file, or null if not found</returns>
Expand Down
2 changes: 2 additions & 0 deletions Common/Interfaces/IRegressionResearchDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ namespace QuantConnect.Interfaces
/// </summary>
public interface IRegressionResearchDefinition
{
#pragma warning disable CS1574
/// <summary>
/// This is used by the research regression test system to validate the output
/// </summary>
/// <remarks>Requires to be implemented last in the file <see cref="ResearchRegressionTests.UpdateResearchRegressionOutputInSourceFile"/>
/// get should start from next line</remarks>
#pragma warning restore CS1574
string ExpectedOutput { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static string ZeroInitialPriceValue(DateTime frontierTimeUtc, Algorithm.F
}

/// <summary>
/// Provides user-facing messages for the <see cref="Algorithm.Framework.Alphas.Analysis.ReadOnlySecurityValuesCollection"/> class and its consumers or related classes
/// Provides user-facing messages for the <see cref="ReadOnlySecurityValuesCollection"/> class and its consumers or related classes
/// </summary>
public static class ReadOnlySecurityValuesCollection
{
Expand Down
2 changes: 1 addition & 1 deletion Common/Messages/Messages.QuantConnect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace QuantConnect
public static partial class Messages
{
/// <summary>
/// Provides user-facing messages for the <see cref="QuantConnect.AlphaRuntimeStatistics"/> class and its consumers or related classes
/// Provides user-facing messages for the <see cref="AlphaRuntimeStatistics"/> class and its consumers or related classes
/// </summary>
public static class AlphaRuntimeStatistics
{
Expand Down
2 changes: 1 addition & 1 deletion Common/Messages/Messages.Securities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public static string MarginBeingAdjustedInTheWrongDirectionUnderlyingSecurityInf
}

/// <summary>
/// Provides user-facing messages for the <see cref="Securities.PositionGroupBuyingPowerModel"/> class and its consumers or related classes
/// Provides user-facing messages for the <see cref="Securities.Positions.PositionGroupBuyingPowerModel"/> class and its consumers or related classes
/// </summary>
public static class PositionGroupBuyingPowerModel
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace QuantConnect.Optimizer.Parameters
{
/// <summary>
/// Override <see cref="OptimizationParameter"/> deserialization method.
/// Can handle <see cref="OptimizationArrayParameter"/> and <see cref="OptimizationStepParameter"/> instances
/// Can handle <see cref="OptimizationStepParameter"/> instances
/// </summary>
public class OptimizationParameterJsonConverter : JsonConverter
{
Expand Down
2 changes: 2 additions & 0 deletions Common/Optimizer/Parameters/OptimizationStepParameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ public class OptimizationStepParameter : OptimizationParameter
[JsonProperty("step")]
public decimal? Step { get; set; }

#pragma warning disable CS1574
/// <summary>
/// Minimal possible movement for current parameter, should be positive
/// </summary>
/// <remarks>Used by <see cref="Strategies.EulerSearchOptimizationStrategy"/> to determine when this parameter can no longer be optimized</remarks>
[JsonProperty("minStep")]
#pragma warning restore CS1574
public decimal? MinStep { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ public override InitialMargin GetInitialMarginRequiredForOrder(PositionGroupInit

/// <summary>
/// Gets the initial margin required for the specified contemplated position group.
/// Used by <see cref="GetReservedBuyingPowerImpact"/> to get the contemplated groups margin.
/// Used by <see cref="QuantConnect.Securities.Positions.PositionGroupBuyingPowerModel.GetReservedBuyingPowerImpact"/> to get the contemplated groups margin.
/// </summary>
protected override decimal GetContemplatedGroupsInitialMargin(SecurityPortfolioManager portfolio, PositionGroupCollection contemplatedGroups,
List<IPosition> ordersPositions)
Expand Down
1 change: 0 additions & 1 deletion Common/Securities/Volatility/IndicatorVolatilityModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ namespace QuantConnect.Securities
/// Provides an implementation of <see cref="IVolatilityModel"/> that uses an indicator
/// to compute its value
/// </summary>
/// <typeparam name="T">The indicator's input type</typeparam>
public class IndicatorVolatilityModel : BaseVolatilityModel
{
private readonly IIndicator _indicator;
Expand Down
2 changes: 1 addition & 1 deletion Common/Util/PythonUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public static string PythonExceptionParser(PythonException pythonException)
}

/// <summary>
/// Parsers <see cref="PythonException.Message"/> into a readable message
/// Parsers <see cref="Exception.Message"/> into a readable message
/// </summary>
/// <param name="message">The python exception message</param>
/// <returns>String with relevant part of the stacktrace</returns>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
namespace QuantConnect.Lean.Engine.DataFeeds.Enumerators
{
/// <summary>
/// Enumerates live options symbol universe data into <see cref="OptionChainUniverseDataCollection"/> instances
/// Enumerates live options symbol universe data into <see cref="BaseDataCollection"/> instances
/// </summary>
public class DataQueueOptionChainUniverseDataCollectionEnumerator : IEnumerator<BaseDataCollection>
{
Expand Down
Loading

0 comments on commit 5a7a162

Please sign in to comment.