PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: platers/obsidian-linter (ts)
Issue: FR: Capitalize Headings, The words in the Lowercase words list to be Uppercase when it is the first letter
I want to request that for the function of `Capitalize Headings`, the words listed in `the Lowercase Words` better be uppercase when it is the first letter.

For example:
## the Best of the Best 

should be
## The Best of the Best

Thanks!
Pull request description: Fix Title Case Style Not Capitalizing the First Word
Fixes #171 

Takes care of title case first word capitalization when the first set of characters is not a word.

Changes Made:
- Made sure to not assume the first set of characters would be a word
- Added another header to the title case test case string

Patch:
diff --git a/src/rules.ts b/src/rules.ts
index 81dd85c..2939e21 100644
--- a/src/rules.ts
+++ b/src/rules.ts
@@ -1103,6 +1103,7 @@ export const rules: Rule[] = [
                 const ignoreShortWords = (
                 options['Lowercase Words'] as string
                 ).split(/[,\s]+/);
+                let firstWord = true;
                 for (let j = 1; j < headerWords.length; j++) {
                   const isWord = headerWords[j].match(/^[A-Za-z'-]+[.?!,:;]?$/);
                   if (!isWord) {
@@ -1117,12 +1118,14 @@ export const rules: Rule[] = [
                   if (!keepWordCasing) {
                     headerWords[j] = headerWords[j].toLowerCase();
                     const ignoreWord = ignoreShortWords.includes(headerWords[j]);
-                    if (!ignoreWord || j == 1) {
+                    if (!ignoreWord || firstWord === true) {
                     // ignore words that are not capitalized in titles except if they are the first word
                       headerWords[j] =
                       headerWords[j][0].toUpperCase() + headerWords[j].slice(1);
                     }
                   }
+
+                  firstWord = false;
                 }
 
                 lines[i] = lines[i].replace(


Test patch:
diff --git a/src/test.ts b/src/test.ts
index f29c898..9849979 100644
--- a/src/test.ts
+++ b/src/test.ts
@@ -166,6 +166,7 @@ describe('Rules tests', () => {
         ## this is a sentence.
         ## I can't do this
         ## comma, comma, comma
+        ## 1.1 the Header
         `;
       const after = dedent`
         # h1
@@ -173,6 +174,7 @@ describe('Rules tests', () => {
         ## This is a Sentence.
         ## I Can't Do This
         ## Comma, Comma, Comma
+        ## 1.1 The Header
         `;
       const options = Object.assign({
         'Style': 'Title Case',
Repository: pyfar/pyfar (python)
Issue: io.write(..., compress=True) increases file size
## General

* pyfar version: 0.6.9
* Python version: 3.11.9
* Operating System: Ubuntu 23.10
* Did you install pyfar via pip: yes

## Description
Hi guys, 

I noticed that instead of compressing the data, `pf.io.write()` produces much bigger files when using `compress=True`. 

I tested this with a sine signal. The behavior is consistent for long and short signals and single-channel as well as multi-channel audio. 

When using noise, the difference decreases but the compressed file is still larger than the uncompressed one.

## What I Did

```
import pyfar as pf

signal = pf.signals.sine(frequency=1000, n_samples=44100, amplitude=1, sampling_rate=44100)

pf.io.write('signal_uncompressed', signal=signal)
pf.io.write('signal_compressed', signal=signal, compress=True)
```
`signal_uncompressed.far` is 383.4 kB, while `signal_compressed.far` is 706.7 kB.
Pull request description: hot: fix compress flag in pyfar.io.write
### Which issue(s) are closed by this pull request?

Closes #706

### Changes proposed in this pull request:

- fix usage of compress parameter in ``pyfar.io.write``
- add test whether the compressed file is smaller then the uncompressed one.


Patch:
diff --git a/pyfar/io/io.py b/pyfar/io/io.py
index e8fcb944..a52faf1c 100644
--- a/pyfar/io/io.py
+++ b/pyfar/io/io.py
@@ -316,7 +316,7 @@ def write(filename, compress=False, **objs):
     """
     # Check for .far file extension
     filename = pathlib.Path(filename).with_suffix('.far')
-    compression = zipfile.ZIP_STORED if compress else zipfile.ZIP_DEFLATED
+    compression = zipfile.ZIP_DEFLATED if compress else zipfile.ZIP_STORED
     zip_buffer = io.BytesIO()
     builtin_wrapper = codec.BuiltinsWrapper()
     with zipfile.ZipFile(zip_buffer, "a", compression) as zip_file:


Test patch:
diff --git a/tests/test_io.py b/tests/test_io.py
index f57a871f..7eff393e 100644
--- a/tests/test_io.py
+++ b/tests/test_io.py
@@ -451,6 +451,16 @@ def test_write_read_multiplePyfarObjects(
     assert dict_of_builtins.items() <= actual.items()
 
 
+def test_write_read_compression(sine, tmpdir):
+    """Test whether compressed files are larger than uncompressed files."""
+    filename_compressed = os.path.join(tmpdir, 'sine_compressed.far')
+    io.write(filename_compressed, signal=sine, compress=True)
+    filename_uncompressed = os.path.join(tmpdir, 'sine_uncompressed.far')
+    io.write(filename_uncompressed, signal=sine, compress=False)
+    assert os.path.getsize(filename_uncompressed) > os.path.getsize(
+        filename_compressed)
+
+
 def test_write_read_multiplePyfarObjectsWithCompression(
         filter,
         filterFIR,