[{"url":"https://api.github.com/repos/scikit-rf/scikit-rf/issues/comments/3342961682","html_url":"https://github.com/scikit-rf/scikit-rf/issues/1322#issuecomment-3342961682","issue_url":"https://api.github.com/repos/scikit-rf/scikit-rf/issues/1322","id":3342961682,"node_id":"IC_kwDOADEabM7HQYwS","user":{"login":"jhillairet","id":4642848,"node_id":"MDQ6VXNlcjQ2NDI4NDg=","avatar_url":"https://avatars.githubusercontent.com/u/4642848?v=4","gravatar_id":"","url":"https://api.github.com/users/jhillairet","html_url":"https://github.com/jhillairet","followers_url":"https://api.github.com/users/jhillairet/followers","following_url":"https://api.github.com/users/jhillairet/following{/other_user}","gists_url":"https://api.github.com/users/jhillairet/gists{/gist_id}","starred_url":"https://api.github.com/users/jhillairet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhillairet/subscriptions","organizations_url":"https://api.github.com/users/jhillairet/orgs","repos_url":"https://api.github.com/users/jhillairet/repos","events_url":"https://api.github.com/users/jhillairet/events{/privacy}","received_events_url":"https://api.github.com/users/jhillairet/received_events","type":"User","user_view_type":"public","site_admin":false},"created_at":"2025-09-28T11:16:28Z","updated_at":"2025-09-28T11:16:28Z","body":"Indeed... A slow transition with deprecation warnings should be used to warn users.","author_association":"MEMBER","pin":null,"reactions":{"url":"https://api.github.com/repos/scikit-rf/scikit-rf/issues/comments/3342961682/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"performed_via_github_app":null},{"url":"https://api.github.com/repos/scikit-rf/scikit-rf/issues/comments/3915394938","html_url":"https://github.com/scikit-rf/scikit-rf/issues/1322#issuecomment-3915394938","issue_url":"https://api.github.com/repos/scikit-rf/scikit-rf/issues/1322","id":3915394938,"node_id":"IC_kwDOADEabM7pYC96","user":{"login":"jeinstei","id":33426885,"node_id":"MDQ6VXNlcjMzNDI2ODg1","avatar_url":"https://avatars.githubusercontent.com/u/33426885?v=4","gravatar_id":"","url":"https://api.github.com/users/jeinstei","html_url":"https://github.com/jeinstei","followers_url":"https://api.github.com/users/jeinstei/followers","following_url":"https://api.github.com/users/jeinstei/following{/other_user}","gists_url":"https://api.github.com/users/jeinstei/gists{/gist_id}","starred_url":"https://api.github.com/users/jeinstei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeinstei/subscriptions","organizations_url":"https://api.github.com/users/jeinstei/orgs","repos_url":"https://api.github.com/users/jeinstei/repos","events_url":"https://api.github.com/users/jeinstei/events{/privacy}","received_events_url":"https://api.github.com/users/jeinstei/received_events","type":"User","user_view_type":"public","site_admin":false},"created_at":"2026-02-17T15:30:43Z","updated_at":"2026-02-17T15:30:43Z","body":"This looks like a fun and easy first PR for the project. I would be happy to do it, unless someone is already doing this.","author_association":"NONE","pin":null,"reactions":{"url":"https://api.github.com/repos/scikit-rf/scikit-rf/issues/comments/3915394938/reactions","total_count":1,"+1":1,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"performed_via_github_app":null},{"url":"https://api.github.com/repos/scikit-rf/scikit-rf/issues/comments/3915952365","html_url":"https://github.com/scikit-rf/scikit-rf/issues/1322#issuecomment-3915952365","issue_url":"https://api.github.com/repos/scikit-rf/scikit-rf/issues/1322","id":3915952365,"node_id":"IC_kwDOADEabM7paLDt","user":{"login":"Vinc0110","id":63644854,"node_id":"MDQ6VXNlcjYzNjQ0ODU0","avatar_url":"https://avatars.githubusercontent.com/u/63644854?v=4","gravatar_id":"","url":"https://api.github.com/users/Vinc0110","html_url":"https://github.com/Vinc0110","followers_url":"https://api.github.com/users/Vinc0110/followers","following_url":"https://api.github.com/users/Vinc0110/following{/other_user}","gists_url":"https://api.github.com/users/Vinc0110/gists{/gist_id}","starred_url":"https://api.github.com/users/Vinc0110/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vinc0110/subscriptions","organizations_url":"https://api.github.com/users/Vinc0110/orgs","repos_url":"https://api.github.com/users/Vinc0110/repos","events_url":"https://api.github.com/users/Vinc0110/events{/privacy}","received_events_url":"https://api.github.com/users/Vinc0110/received_events","type":"User","user_view_type":"public","site_admin":false},"created_at":"2026-02-17T17:11:03Z","updated_at":"2026-02-17T17:11:03Z","body":"Cool! I don't think anyone has started this yet. At least there is no such PR.\n\nBut first, I'd like to discuss if it should be 'nports' instead of 'n_ports' (as proposed by @biergaizi ) or the other way around. Personally, I prefer 'n_ports', because mathematically you would write 'n' with the index 'ports' in the subtext. But of course, 'nports' looks a bit cleaner even if it's not a real word.","author_association":"COLLABORATOR","pin":null,"reactions":{"url":"https://api.github.com/repos/scikit-rf/scikit-rf/issues/comments/3915952365/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"performed_via_github_app":null},{"url":"https://api.github.com/repos/scikit-rf/scikit-rf/issues/comments/3917497520","html_url":"https://github.com/scikit-rf/scikit-rf/issues/1322#issuecomment-3917497520","issue_url":"https://api.github.com/repos/scikit-rf/scikit-rf/issues/1322","id":3917497520,"node_id":"IC_kwDOADEabM7pgESw","user":{"login":"jeinstei","id":33426885,"node_id":"MDQ6VXNlcjMzNDI2ODg1","avatar_url":"https://avatars.githubusercontent.com/u/33426885?v=4","gravatar_id":"","url":"https://api.github.com/users/jeinstei","html_url":"https://github.com/jeinstei","followers_url":"https://api.github.com/users/jeinstei/followers","following_url":"https://api.github.com/users/jeinstei/following{/other_user}","gists_url":"https://api.github.com/users/jeinstei/gists{/gist_id}","starred_url":"https://api.github.com/users/jeinstei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeinstei/subscriptions","organizations_url":"https://api.github.com/users/jeinstei/orgs","repos_url":"https://api.github.com/users/jeinstei/repos","events_url":"https://api.github.com/users/jeinstei/events{/privacy}","received_events_url":"https://api.github.com/users/jeinstei/received_events","type":"User","user_view_type":"public","site_admin":false},"created_at":"2026-02-17T22:55:03Z","updated_at":"2026-02-17T22:55:03Z","body":"I will say that you have \"n_sections\" and not \"nsections\", but in terms of raw usage, ignoring tests and notebooks, roughly 83 n_ports and 426 nports (because of the network references). Neither of these are huge numbers.\n\nI prefer n_ports myself -- especially to match n_sections and anything else like that. ","author_association":"NONE","pin":null,"reactions":{"url":"https://api.github.com/repos/scikit-rf/scikit-rf/issues/comments/3917497520/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"performed_via_github_app":null},{"url":"https://api.github.com/repos/scikit-rf/scikit-rf/issues/comments/3919187137","html_url":"https://github.com/scikit-rf/scikit-rf/issues/1322#issuecomment-3919187137","issue_url":"https://api.github.com/repos/scikit-rf/scikit-rf/issues/1322","id":3919187137,"node_id":"IC_kwDOADEabM7pmgzB","user":{"login":"jhillairet","id":4642848,"node_id":"MDQ6VXNlcjQ2NDI4NDg=","avatar_url":"https://avatars.githubusercontent.com/u/4642848?v=4","gravatar_id":"","url":"https://api.github.com/users/jhillairet","html_url":"https://github.com/jhillairet","followers_url":"https://api.github.com/users/jhillairet/followers","following_url":"https://api.github.com/users/jhillairet/following{/other_user}","gists_url":"https://api.github.com/users/jhillairet/gists{/gist_id}","starred_url":"https://api.github.com/users/jhillairet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhillairet/subscriptions","organizations_url":"https://api.github.com/users/jhillairet/orgs","repos_url":"https://api.github.com/users/jhillairet/repos","events_url":"https://api.github.com/users/jhillairet/events{/privacy}","received_events_url":"https://api.github.com/users/jhillairet/received_events","type":"User","user_view_type":"public","site_admin":false},"created_at":"2026-02-18T07:34:24Z","updated_at":"2026-02-18T07:34:24Z","body":"Well, there is also `npoints` in all `Media` classes and in `Frequency`.  And `nports` exists in `Network` for quite a long... While I would prefer `n_ports` with respect to the mathematical writing, I would tend to favour `nports` for consistency...","author_association":"MEMBER","pin":null,"reactions":{"url":"https://api.github.com/repos/scikit-rf/scikit-rf/issues/comments/3919187137/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"performed_via_github_app":null},{"url":"https://api.github.com/repos/scikit-rf/scikit-rf/issues/comments/3920900068","html_url":"https://github.com/scikit-rf/scikit-rf/issues/1322#issuecomment-3920900068","issue_url":"https://api.github.com/repos/scikit-rf/scikit-rf/issues/1322","id":3920900068,"node_id":"IC_kwDOADEabM7ptC_k","user":{"login":"Vinc0110","id":63644854,"node_id":"MDQ6VXNlcjYzNjQ0ODU0","avatar_url":"https://avatars.githubusercontent.com/u/63644854?v=4","gravatar_id":"","url":"https://api.github.com/users/Vinc0110","html_url":"https://github.com/Vinc0110","followers_url":"https://api.github.com/users/Vinc0110/followers","following_url":"https://api.github.com/users/Vinc0110/following{/other_user}","gists_url":"https://api.github.com/users/Vinc0110/gists{/gist_id}","starred_url":"https://api.github.com/users/Vinc0110/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vinc0110/subscriptions","organizations_url":"https://api.github.com/users/Vinc0110/orgs","repos_url":"https://api.github.com/users/Vinc0110/repos","events_url":"https://api.github.com/users/Vinc0110/events{/privacy}","received_events_url":"https://api.github.com/users/Vinc0110/received_events","type":"User","user_view_type":"public","site_admin":false},"created_at":"2026-02-18T13:41:39Z","updated_at":"2026-02-18T13:42:11Z","body":"That's ok for me. Consistency is important, so let's have 'nports' everywhere.","author_association":"COLLABORATOR","pin":null,"reactions":{"url":"https://api.github.com/repos/scikit-rf/scikit-rf/issues/comments/3920900068/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"performed_via_github_app":null},{"url":"https://api.github.com/repos/scikit-rf/scikit-rf/issues/comments/3983854702","html_url":"https://github.com/scikit-rf/scikit-rf/issues/1322#issuecomment-3983854702","issue_url":"https://api.github.com/repos/scikit-rf/scikit-rf/issues/1322","id":3983854702,"node_id":"IC_kwDOADEabM7tdMxu","user":{"login":"biergaizi","id":1310693,"node_id":"MDQ6VXNlcjEzMTA2OTM=","avatar_url":"https://avatars.githubusercontent.com/u/1310693?v=4","gravatar_id":"","url":"https://api.github.com/users/biergaizi","html_url":"https://github.com/biergaizi","followers_url":"https://api.github.com/users/biergaizi/followers","following_url":"https://api.github.com/users/biergaizi/following{/other_user}","gists_url":"https://api.github.com/users/biergaizi/gists{/gist_id}","starred_url":"https://api.github.com/users/biergaizi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biergaizi/subscriptions","organizations_url":"https://api.github.com/users/biergaizi/orgs","repos_url":"https://api.github.com/users/biergaizi/repos","events_url":"https://api.github.com/users/biergaizi/events{/privacy}","received_events_url":"https://api.github.com/users/biergaizi/received_events","type":"User","user_view_type":"public","site_admin":false},"created_at":"2026-03-02T11:40:35Z","updated_at":"2026-03-02T12:26:54Z","body":"> I will say that you have \"n_sections\" and not \"nsections\", but in terms of raw usage, ignoring tests and notebooks, roughly 83 n_ports and 426 nports (because of the network references). Neither of these are huge numbers.\n\nI didn't propose changing `n_ports` to `nports` without a reason. \n\nAlthough both `n_ports` and `nports` are used in \"seemingly\" many places, but they're mostly internal variable names only. One should look at API usage, not raw usage, and make a decision based on API consistency.\n\nIf you grep the keyword `n_ports` in the codebase, you would see that `random()` is the only public API that uses the argument `n_ports`, all other APIs have `nports`.  I think one should break 1 API instead of all APIs in the `Media` class. \n\nThe results are:\n\n> doc/source/examples/metrology/LRRM.ipynb\n> doc/source/examples/metrology/Measuring a Mutiport Device with a 2-Port Network Analyzer.ipynb\n> doc/source/examples/metrology/Multi-port Calibration.ipynb\n> doc/source/examples/metrology/Multi-port Calibration.ipynb\n> doc/source/examples/metrology/NanoVNA_V2_4port-splitter.ipynb\n\n10 occurrences. Use of the API `Media.random()`.\n\n> skrf/calibration/deembedding.py\n\n4 occurrences. Internal variable names.\n\n> skrf/calibration/tests/test_calibration.py\n\n186 occurrences. Use of the API `Media.random()`, and internal variable names.\n\n> skrf/calibration/tests/test_calibrationSet.py\n\n8 occurrences. Use of the API `Media.random()`, and internal variable names.\n\n> skrf/circuit.py\n\n5 occurrences. Internal docstring names.\n\n> skrf/media/media.py\n\nThe only two places where `n_ports` is used in the public API: `random()` and the rarely used `white_gaussian_polar()`\n\n> skrf/media/tests/test_media.py:        gnd = self.dummy_media.short(n_ports=1)\n\nBug! Incorrect variable name `n_ports` used for `short()`. It should be `nports`!\n\n> skrf/network.py\n\nInternal variables.\n\n> skrf/vectorFitting.py.\n\nInternal variables.\n\nMeanwhile, the term `nports` appeared in 597 places (both internal and external), for external APIs, it appeared almost everywhere, in instrumentation control, the network class, the microwave device class, and the circuit class.\n\n* `skrf/vi/vna/keysight/fieldfox.py: def nports(self) -> int`\n* `skrf/media/device.py:        self.c1 = MatchedSymmetricCoupler(media=media,c=c1,nports=3,**c1kw)`. \n* `skrf/network.py:def n_twoports_2_nport(ntwk_list: Sequence[Network], nports: int`\n* `skrf/circuit.py:        max_nports : int, optional`\n\nChanging all of `nports` to `n_ports` will be a huge disruption for both project maintainers and end users, while changing `n_ports` to `nports` is a trivial decision. Do we break all APIs and change the project's entire naming convention, or do we break only two APIs to fit within the existing naming convention, the choice is obvious.\n\n---\n\n\n> This looks like a fun and easy first PR for the project.\n\nWhile the problem is easy, I won't say it's \"fun\", so this is probably why nobody has submitted a patch. To do it properly, the PR should not just change the variable name, but instead.\n\nDuring the transition stage:\n\n1. One cannot just change `n_ports` to `nports`, the old `n_ports` must also be redirected to `nports`. Leaving both `nports` and `n_ports` in the argument list would be confusing and sensitive to argument position, so it's better to be handled as a special case via `**kwargs`.\n\n2. If `n_ports` is used, the program should raise a clearly-worded runtime deprecation warning. The same deprecation warning shoud appear in the docstring of `random()`.\n\n3. All uses of `n_ports` in documentation, examples, and test cases must be updated.\n\nIf you're willing to make a contribution that fits the criteria, patch welcome. \n\nDuring the removal stage: if `n_ports` is used, the program should raise a hard error instead of a warning. Also, we cannot just delete the alias, because scikit-rf allows one to pass unused `kwargs` around, unknown arguments are ignored without raising any errors. After `n_ports` is deprecated, a user can accidentally use it without knowing it's ignored, so an alarming `n_ports` error must be special-cased.\n\nBTW, as a side note, I dislike the current design of the `kwargs`, it's passed around  ultimately into `skrf.Network` without raising any error, so any typo would be silently ignored without warnings or errors, potentially wasting hours.\n\n```python\n>>> import skrf\n>>> import skrf.media\n\n>>> # No error, no warning!\n>>> skrf.Network(this_argument_does_not_exist=True)  \n0-Port Network: '',  [no freqs], z0=(50+0j)\n\n>>> # No error, no warning!\n>>> skrf.media.DefinedGammaZ0().random(n_ports=1, this_argument_does_not_exist=True)\n1-Port Network: '',  1.0-10.0 GHz, 101 pts, z0=[50.+0.j]\n```\n\nI prefer validating `kwargs` in a global allowlist, but I think such validation is no longer possible given the current status quo: we're too late. It would break an unknown number of applications. Perhaps in the future, we can raise a warning instead of a hard error.","author_association":"COLLABORATOR","pin":null,"reactions":{"url":"https://api.github.com/repos/scikit-rf/scikit-rf/issues/comments/3983854702/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"performed_via_github_app":null},{"url":"https://api.github.com/repos/scikit-rf/scikit-rf/issues/comments/3986590100","html_url":"https://github.com/scikit-rf/scikit-rf/issues/1322#issuecomment-3986590100","issue_url":"https://api.github.com/repos/scikit-rf/scikit-rf/issues/1322","id":3986590100,"node_id":"IC_kwDOADEabM7tnomU","user":{"login":"Vinc0110","id":63644854,"node_id":"MDQ6VXNlcjYzNjQ0ODU0","avatar_url":"https://avatars.githubusercontent.com/u/63644854?v=4","gravatar_id":"","url":"https://api.github.com/users/Vinc0110","html_url":"https://github.com/Vinc0110","followers_url":"https://api.github.com/users/Vinc0110/followers","following_url":"https://api.github.com/users/Vinc0110/following{/other_user}","gists_url":"https://api.github.com/users/Vinc0110/gists{/gist_id}","starred_url":"https://api.github.com/users/Vinc0110/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vinc0110/subscriptions","organizations_url":"https://api.github.com/users/Vinc0110/orgs","repos_url":"https://api.github.com/users/Vinc0110/repos","events_url":"https://api.github.com/users/Vinc0110/events{/privacy}","received_events_url":"https://api.github.com/users/Vinc0110/received_events","type":"User","user_view_type":"public","site_admin":false},"created_at":"2026-03-02T19:57:44Z","updated_at":"2026-03-02T19:57:44Z","body":"OMG, @biergaizi you are killing me. You certainly have a point and your described to-do list sounds very reasonable, but I don't think such a strict and error-proof procedure is required here. After all, as you wrote yourself, scikit-rf has many historical oddities and I have a feeling the average user can accept if an old script fails with a new version of scikit-rf. Others can stick with a previous version. We should not break the API all the time, but it can be done and it's not the end of the world.","author_association":"COLLABORATOR","pin":null,"reactions":{"url":"https://api.github.com/repos/scikit-rf/scikit-rf/issues/comments/3986590100/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"performed_via_github_app":null}]